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,
[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
.
Take a look at the Ember-data library, it was made for your use-case and related use-cases:
https://github.com/emberjs/data