Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "billalayub"

Hi, I started developing a new module in ASPNetZero AngularJs by reading aspnetzero.com step by step development guide for ASP.NET MVC 5.x & Angularjs 1.x and I got error success is not a function error in DevTool by chrome.

Attached are error, code of index.js and index.cshtml:

Error: Registered to the SignalR server! angular.min.js:122 TypeError: employeeService.getEmployees(...).success is not a function at new <anonymous> (<a class="postlink" href="http://localhost:6240/App/tenant/views/hrm/employees/index.js:9:46">http://localhost:6240/App/tenant/views/ ... ex.js:9:46</a>) at Object.invoke (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:43:171">http://localhost:6240/Scripts/angular.min.js:43:171</a>) at R.instance (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:93:35">http://localhost:6240/Scripts/angular.min.js:93:35</a>) at n (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:68:42">http://localhost:6240/Scripts/angular.min.js:68:42</a>) at g (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:60:496">http://localhost:6240/Scripts/angular.min.js:60:496</a>) at <a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:60:119">http://localhost:6240/Scripts/angular.min.js:60:119</a> at Object.<anonymous> (<a class="postlink" href="http://localhost:6240/Scripts/angular-ui-router.min.js:7:24965">http://localhost:6240/Scripts/angular-u ... js:7:24965</a>) at <a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:16:71">http://localhost:6240/Scripts/angular.min.js:16:71</a> at ta (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:84:35">http://localhost:6240/Scripts/angular.min.js:84:35</a>) at n (<a class="postlink" href="http://localhost:6240/Scripts/angular.min.js:69:226">http://localhost:6240/Scripts/angular.min.js:69:226</a>) <div ui-view="" class="fade-in-up ng-scope"> (anonymous) @ angular.min.js:122

index.js: (function () { appModule.controller('tenant.views.hrm.employees.index', [ '$scope', 'abp.services.app.employees', function ($scope, employeeService) { var vm = this;

        vm.employees = [];

        employeeService.getEmployees({}).success(function (result) {
            vm.employees = result.items;
        });

    }
]);

})();

index.cshtml: <div ng-controller="tenant.views.hrm.employees.index as vm"> <div class="row margin-bottom-5"> <div class="col-xs-12"> <div class="page-head"> <div class="page-title"> <h1> <span>@L("Employees")</span> </h1> </div> </div> </div> </div> <div class="portlet light"> <div class="portlet-body">

        &lt;h3&gt;@L("AllEmployees")&lt;/h3&gt;

        &lt;div class=&quot;list-group&quot;&gt;
            &lt;a href=&quot;javascript:;&quot; class=&quot;list-group-item&quot; ng-repeat=&quot;employee in vm.employees&quot;&gt;
                &lt;h4 class=&quot;list-group-item-heading&quot;&gt;
                    {{employee.name}} {{employee.surname}}
                &lt;/h4&gt;
                &lt;p class=&quot;list-group-item-text&quot;&gt;
                    {{employee.emailAddress}}
                &lt;/p&gt;
            &lt;/a&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;

</div>

Whats wrong with it???

Showing 1 to 1 of 1 entries