taskApp.service('taskService', ['$http',
function ($http) {
this.getTaskList = function () {
$http.get("tasks.json").then(function (response) {
return response.data; //приходит undefined в контроллер, НИПАНЯТНА :)
}).catch(function (error) {
console.log(error.status);
});
};
}
]);
service.getTasksList().then( function(data) { controller.tasks = data; });
return $http.get("tasks.json").then(function(response){
return response.data;
});