title: Calling a function on a component from the controller
body: <p>I like your opinion on this pattern. I wanted to be able to call focus function on a component from my controller, the way I implemented it was a reference to of itself by an action defined on the controller then call the method on it. It works fine just wondering if some sort anti-pattern I should stay away from?</p>
  
  <pre><code>{{x-input bindingAction=(action "bindInput")}}
  
  &lt;button {{action "focusOnInput"&gt;Focus on input&lt;/button&gt;
  
   // x-input.js
  import Ember from 'ember';
  
  export default Ember.Component.extend({
  
    init() {
      this._super();
      if (!Ember.isNone(this.get('bindingAction')) {
       this.get('bindingAction')(this)
      }   
    }
  
    focus() {
      // focus on component.
    }
  
  });
  
  
  // controller.js
  import Ember from 'ember';
  
  export default Ember.Controller.extend({
  
  actions: {
  
      bindInput(input) {
         this.set('input', input);    
      }
  
      focusOnInput() {
         this.get('input').focus();       
      }
  
  }
  });
  </code></pre>