I write simple factory which call to my rest endpont, but I would like use different address not only one, but when I execute query from $resource I get only text function in my console log.
This is my factory:
angular.module('blogfontApp.services', []).factory('Blog', function ($resource) {
return {
getAll : function () {
return $resource('http://localhost:8080/api/blog');
}
}
});
and my controller:
angular.module('blogfontApp.controllers', []).controller('BlogListController',
function ($scope, Blog ) {
$scope.bloglist = Blog.getAll.query();
console.log($scope.bloglist);
});
How to call to different address from my factory?