Simple question.
I have this resource:
var Company = $resource(\"/company/:_id\", {_id: \"@_id\"});
That I want to share between d
Just put in a service or factory.
angular.module("myApp", []).
factory("CompanyResource", function ($resource) {
return $resource("/company/:_id", {_id: "@_id"});
});
and then you can use it in the controller with
function MapCtrl($scope, $resource, $location, CompanyResource) {
...
CompanyResource.query();
...
}
Note that you do not need the $ sign in front of the factory name.