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;});
}
}]); 
Harshal ThakrePosted Jul 14, 2017, 1:34 PM