1

I'm now transitioning to Ember Data 1.0 beta from 0.13.

And I want to use find method in Em.Object like below.

App.SessionManager = Em.Object.extend({
  init: function() {
    var self = this;
    this.store.find('user', 1).then(function(user) {
      self.set('user', user);
    });;
  },
});

How can I achive this?

In this document, using App.inject is suggested. But this can be applied to Ember.Object?

4

1 回答 1

0

我刚刚使用container.lookup("store:main")并将其设置为我的对象上的一个属性,称为store. 然后在对象中我可以this.store像往常一样使用。

于 2013-09-02T17:58:14.803 回答