title: Passing data to factory method in AngularJs
body: <p>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 ?</p>
  
  <pre><code>myApp.factory('Survey', function ($resource) {
      var url; //I need this value somehow from template
      return $resource(url, {surveyId: '@id'});
  });
  </code></pre>
  
  <p>Or should I use some other method or approach for this?</p>