TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sudheen
1.4k
313
83.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
Reply
Answers (
1
)
AngularJS: update the model in parent scope from inside the
How to chk adobe flash player installed or nt using angularj