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
Harshal Thakre
1.5k
235
77.4k
Cannot read property 'getSubs' of undefined.
Jul 14 2017 8:52 AM
AngularScript?v=Sn4qt-PnIXwAS34HPmPOJw1QPMEWLxfWx5TyWFOzC2g1:1
TypeError: Cannot read property 'getSubs' of undefined
Note: When i use bundle(Minify) then it gets stuck otherwise works properly
My Code :
Controller.JS Code :
var app;
(function () {
app = angular.module("APICourseModule", []);
})();
app.controller('APICourseController', ['$scope', function ($scope, APICourseService) {
getAll();
function getAll() {
var servCall = APICourseService.getSubs();
servCall.then(function (d) {
$scope.course = d;},
function (error) {console.log('Oops! Something went wrong while fetching the data.')});
}
}]);
Service.js code:-
app.service("APICourseService", ['$http',function ($http) {
this.getSubs = function () {
var url = 'api/Course';
return $http.get(url).then(function (response) {return response.data;});
}
}]);
Reply
Answers (
1
)
ListBox example
design pattern for .net developer