title: Emberjs How to update property on a component from route?
body: <p>Hi I would like to know what's the proper way to update a property on a component from the route?.</p>
  
  <p>A little background on what I want to do:</p>
  
  <p>I have two custom Buttons that I called CardButtons (based on material desing)  next to one blank area called description, what I want is to create a hover event that triggers an ajax call to retrive detailed data from a data base and render it on the description area.</p>
  
  <p><strong>CHECK UPDATE</strong></p>
  
  <p>So far I have created a route like this:</p>
  
  <pre><code>export default Ember.Route.extend({
  
  selectedModule: '',
  
  model: function () {
  
      return {
          selectedModule: 'employeeModule'
      };
  },
  
  
  actions: {
  
      showDescription: function (params) {
  
          this.set('model.selectedModule', params);
  
      }
  
  }});
  </code></pre>
  
  <p>My route template call my component like this: </p>
  
  <pre><code>&lt;div class="row"&gt;  
     {{sis-db-description-render idTitle=model.selectedModule}}
  &lt;/div&gt;
  </code></pre>
  
  <p>and the component is defined like this:</p>
  
  <pre><code>export default Ember.Component.extend({
  
  info: null,
  ready: false,
  
  didInsertElement: function () {
  
      this.queryData();
  
  
  },
  
  queryData: function (){
       /** Does an Ember.$.post request to the API  with the idTitle as param**/
  }
  });
  </code></pre>
  
  <p>the first time this executes it load perfectly the detail data but when I try to refresh the data the event does not trigger a second call. I bealive it is beacause I'm not updating the model in a proper way.</p>
  
  <p>Any idea on how to update the component property?</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>Thanks to @kumkanillam I was able to find a way on my route I added the next code: </p>
  
  <pre><code> setupController: function (controller, model) {
  
      this._super(...arguments); //if its new/index.js route file then you can use controller argument this method.
      controller.set('selectedModule', 'employeeModule');
  },
  
  
  actions: {
  
      showDescription: function (params) {
  
          console.info(params);
          this.controllerFor('new.index').set('selectedModule', params);
  
      }
  
  }
  </code></pre>
  
  <p>By doing so now the view updates the content every time, I still don't know if this is the correct way to do it but it works for  now.</p>