0

I've been working on a project and get this error that i cant solve.

angular.js:14525 
    TypeError: EmpApi.getEmployees(...).success is not a function
    at getEmployees (demo.js:146)
    at new <anonymous> (demo.js:144)
    at Object.instantiate (angular.js:5018)
    at $controller (angular.js:10881)
    at Object.link (angular-route.js:1214)
    at angular.js:1346
    at invokeLinkFn (angular.js:10426)
    at nodeLinkFn (angular.js:9815)
    at compositeLinkFn (angular.js:9055)
    at publicLinkFn (angular.js:8920) "<div ng-view="" class="ng-scope">

Demo.js that i am using

MyApp.controller("HomeController", function ($scope, EmpApi) {

    getEmployees();
    function getEmployees() {
        EmpApi.getEmployees().success(function (emps) {
            $scope.emps = emps;

        })
        .error(function(error){
            $scope.status = 'Unable to load emp data:' + error.message;

        })
    }
});
georgeawg
  • 48,608
  • 13
  • 72
  • 95

0 Answers0