Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Access store inside component

$
0
0

@ghoshnirmalya wrote:

I've the following code:

export default Ember.Component.extend({
  store: Ember.inject.service(),
  types: [ 'Task', 'Discussion', 'Note' ],
  projects: this.get('store').find('user', 1).then(user => user.get('projects')),
  actions: {
    save() {
      ...
    }
  }
})

I want to access store in line 4 like projects: this.get('store').find('user', 1).then(user => user.get('projects')).

How can I do that?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles