title: Correct way to make an ajax call from EmberJs component?
body: <p>I would like to know what is the correct way to make an ajax call from an ember component. for example</p>
  
  <p>I want to create a reusable component that makes an employee search by employee's Id, then when the response comes back from the server I want to update the model with the data from the ajax response.</p>
  
  <p>I don´t know if this is the correct way to do it, I'm really new on emberjs.</p>
  
  <pre><code>export default Ember.Component.extend({
  ajax: Ember.inject.service(),
  actions: {
      doSearch() {
          showLoadingData();
          var self = this;
          this.get('ajax').post('http://server.ip.com/api/v1/getEmployee', { "id": this }).then(function(data) {
              self.set('model.name', data.name);
              self.set('model.position', data.position);
              hideLoadingData();
          });
      }
  }});
  </code></pre>