I am trying to build links in factory. I need to reach the url variable from template like data-url attribute. The problem is that I don't know how to reach it when I am in factory. Maybe there is some way of using directives to get the data-url attribute ?
myApp.factory('Survey', function ($resource) {
var url; //I need this value somehow from template
return $resource(url, {surveyId: '@id'});
});
Or should I use some other method or approach for this?
$rootScopehowever when I pass attribute from controller$attrsto$rootScope. It some how executes the factory function before the attributes are actually stored in the$rootScope.