sudheen

sudheen

  • 1.3k
  • 308
  • 81.6k

Angular Reference issue

May 23 2017 1:28 AM
Hi All,
 
I new to angular js ,Iam facing some issue in controller and service js files ,please find below code .
 
app.controller('API Controller', function ($scope, APIService) {
debugger;
LoadRecords();
function LoadRecords() {
var servcall = APIService.GetEmployees();
servcall.then(function (d) {
$scope.Employees = d.data;
}, function (error) {
$log.error('Oops! Something went wrong while fetching the data.')
});
}
});
 
 
 Service.js
app.service('APIService', function ($http)
{
 this.GetEmployees=function()
{
return $http.get("api/Employee_New");
}
 
 
when i run the application js file showing following error
for controller 
Uncaught TypeError: Cannot read property 'controller' of undefined 
 
 for Service.js
 
Uncaught TypeError: Cannot read property 'service' of undefined 
 
 
 
 
 
 
 
 
 
 
 
 
 

Answers (1)