title: Iron Router: Pass data to client via meteor method
body: <p>My application uses iron router: When a user hits a certain route that contains a wildcard, I would like to use the value of the wildcard to call a meteor method and have its return value be used to set the data context for the template.</p>
  
  <p>Example:</p>
  
  <p>Meteor method:</p>
  
  <pre><code>getUserName: function(id){
      return Meteor.users.findOne({_id: id}).profile.name;
  }
  </code></pre>
  
  <p>Router:</p>
  
  <pre><code>data: function(){
          Meteor.call('getUserName', this.params.userId, function(error, result){
  
          });
      }
  </code></pre>
  
  <p>The meteor method returns the correct value and I can access that value in the callback function. But my problem is that I don't know how to actually use that data. Just returning it from the callback doesn't work.</p>
  
  <p>What is the right way to do this? Or is it not a got idea at all to call a Meteor method in this case? What is the alternative then?</p>
  
  <p>Thank you very much for your answers!</p>