Base solution for your next web application
Open Closed

Problem calling ABP application service in AJAX #557


User avatar
0
lauriep created

Hi,

Sorry for what is probably a beginner question.

I am confident that I have wired up my new app service properly for WebApi as I can call it in Chrome developer tools:

[attachment=2:cz22gv4t]Capture.JPG[/attachment:cz22gv4t] [attachment=1:cz22gv4t]Capture2.JPG[/attachment:cz22gv4t]

However, when I try and call the service in the AngularJS controller I get "h = Object doesn't support property or method 'GetSupplierforCurrentUserAsync'"

In debug mode, I can see that the service is instantiated and the method is available:

[attachment=0:cz22gv4t]Capture3.JPG[/attachment:cz22gv4t]

Are you able to give me a pointer as to what is going wrong please? Full JS code:

(function () {
    appModule.controller('tenant.views.dashboard.index', [
        '$scope', 'abp.services.app.tenantDashboard', 'abp.services.app.supplier',
        function ($scope, tenantDashboardService, supplierService) {
            var vm = this;

            $scope.$on('$viewContentLoaded', function () {
                Metronic.initAjax();
            });

....
            vm.getMemberActivity();

            vm.SupplierName = "";

            supplierService.GetSupplierforCurrentUserAsync({}).success(function (result) {
                vm.SupplierName = result.Name;
            });


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    If should be camelCase like 'getSupplierforCurrentUserAsync' instead of 'GetSupplierforCurrentUserAsync'.

    Have a nice day :)

  • User Avatar
    0
    lauriep created

    All good. Many thanks for the quick response.