I am trying to return a value from my AngularJs service to my controller where ever I pass it inside the controller.It does pass the object and also log the data in the console. Here is my code:
angular.module('demoService',[])
.factory('myService',
function($http) {
return {
getAll: function (items) {
var path = "http://enlytica.com/RSLivee/rest/census"
$http.get(path).success(function (items) {
console.log(items.Tweets[1].FAVOURITE_COUNT);
});
}
}
});
How do i return the "items.Tweets[1].FAVOURITE_COUNT" on function call.
Thanks in advance