title: backbone passing parameters to a model url
body: <p>In my controller I'm passing in a parameter called 'url' to a view. This is passed successfully into the initialize function. Next when I create my model I would like to pass the same parameter into the model to use as the rooturl.</p>
  
  <p>Below is what I have tried but I got the following error message:</p>
  
  <pre><code>A "url" property or function must be specified 
  </code></pre>
  
  <p>This seems like the parameter is not being passed to the model (undefined) or I'm not calling it correctly in the model. <strong>What I'm I doing wrong here?</strong></p>
  
  <p><strong>Note:</strong> console.log(options.url) in the initialize function view confirms the parameter is passed successfully from the controller to the view, the issues is from the view to the model where it is undefined.</p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>var myview = new NewView({
             url:"api/"
         })**
  </code></pre>
  
  <p><strong>View:</strong></p>
  
  <pre><code>  var myview = Backbone.Marionette.ItemView.extend({
  
          initialize: function (options) {
              this.url = options.url;
              this.model.fetch();
          },
  
  
      model: new myModel({
              url: this.url
          }),
  </code></pre>
  
  <p><strong>myModel:</strong></p>
  
  <pre><code>var myModel = Backbone.Model.extend({
    urlRoot: function(){ return this.get('url') }
  
  });
  </code></pre>