title: looking up in store from a component
body: <p>I have a template that includes a component. </p>
  
  <pre><code>// pods/workgroup/template.hbs
  ...
  {{workgroup/member-add
      wgId=model.id
      store=store
      peekUser2Workgroup=peekUser2Workgroup
  }}
  ...
  </code></pre>
  
  <p>Within that component I need to lookup if something is already present in the store.</p>
  
  <pre><code>//somewhere in components/workgroup/member-add/componsent.js
  let alreadyInStore = this.store.peekRecord('user2workgroup',u2wId);
  </code></pre>
  
  <p>I made it work by injecting the store into the component (as above), which of course is bad practise.<br>
  So I tried making a property in my parent-controller that does the store lookup:</p>
  
  <pre><code>//in components/workgroup/member-add/componsent.js
  let alreadyInStore = this.get('controller').peekUser2Workgroup(u2wId);
  
  
  //in pods/workgroup/controller.js
  peekUser2Workgroup: function(u2wId) {
      console.log(this);
      console.log(this.store);
      return this.store.peekRecord('user2workgroup',u2wId);
  }
  </code></pre>
  
  <p>This works fine as long as I pass the complete store into the compentent as above.<br>
  However, if I <em>don't</em> pass the store to the component it get's undefined, although never accessed from the component directly (the store is present in the controller alone).</p>
  
  <p>Logging into console of <code>this</code> gives me surprisingly the component, not the controller, <code>this.store</code> is undefined.<br>
  So I've learned, that with <code>this</code> I don't access the controller itself when a function/parameter gets called from outside/a component.</p>
  
  <p><strong>The question is</strong>, how can I make the controller to reference to itself with <code>this</code>?<br>
  Or how can I access the store when calling a parameter from outside?<br>
  Do I really need to pass the controller itself to himself??<br>
  like so:</p>
  
  <pre><code>// in component
  let alreadyInStore = this.get('controller').peekUser2Workgroup(this.get('controller'), u2wgId);
  
  //in controller
  peekUser2Workgroup: function(myself, u2wId) {
      console.log(this);
      console.log(this.store);
      return myself.store.peekRecord('user2workgroup',u2wId);
  }
  </code></pre>
  
  <p>That seems very odd to me, and looks like I'm shifting around even more than I did initially when simply injecting the store to the controller...</p>
  
  <p>Ember: 2.0.1
  Ember-Data: 2.0.0</p>