How to bind content with JSON in Ember.js

后端 未结 2 987
逝去的感伤
逝去的感伤 2021-02-06 12:17

All the examples are using fixed data source in the arraycontroller.content, while I am using dynamic data source which is generated from anther web service and returns a JSON,

2条回答
  •  一生所求
    2021-02-06 13:10

    [2014-02-19: Deprecated - I no longer support ember-rest because it is overly simplistic, and would recommend using ember-data for most ember projects. Check out the Ember guides for an overview of ember-data as well as this example project ]

    I've created a very simple library to handle working with REST interfaces from Ember: https://github.com/cerebris/ember-rest

    I'm also writing a series of posts about using this library from Rails. The first is here: http://www.cerebris.com/blog/2012/01/24/beginning-ember-js-on-rails-part-1/

    My next post, hopefully coming later today, deals precisely with loading data via AJAX into a collection of Ember objects. For now, you can see this behavior in the sample app as well as the ember-rest.js readme.

    If you'd like to avoid using this lib, you might still want to check out the source. The deserialize() method on Ember.Resource is used to import JSON and could also be used with a generic Ember.Object.

提交回复
热议问题