Does ember.js still support ObjectController? If not, what replaces it?

前端 未结 3 1269
死守一世寂寞
死守一世寂寞 2021-01-14 01:36

I\'m trying to learn some Ember.js and while I realize everything is in flux and the moment, it seems that this bit of code from the Sproutcore 2 guides (which are linked to

相关标签:
3条回答
  • 2021-01-14 02:15

    There are plans to bring back ObjectController/ObjectProxy. Peter and I have started working on it here, but we need to add some lower level functionality to Ember before it can be fully supported.

    Until then, you can use Ember.Object with a content property. You'll have to explicitly reference the content property in property paths (eg. App.userController.content). When ObjectController is finished you'll be able to switch your controllers to inherit from it instead and you can update your property paths to not explicitly reference content.

    0 讨论(0)
  • 2021-01-14 02:31

    UPDATED: Yes, Ember.ObjectController is a first-class part of Ember and is most frequently used to proxy a model's properties for easy rendering by templates. See http://emberjs.com/api/classes/Ember.ObjectController.html for documentation.

    0 讨论(0)
  • 2021-01-14 02:37

    It's in master now, see: https://github.com/emberjs/ember.js/commit/c6954ba40ab9f007dd499634bfccf40fc31a73d7

    0 讨论(0)
提交回复
热议问题