Reputation: 633
As a way of learning AngularJS, I designed a very basic app that consumes data from a JSON API and simply throws it to the screen (the code is on Github.) Now I'm learning Ember.js and I simply can't get how to achieve the same result. Using as little code as possible, what would be a simple way of consuming data from a public JSON API (e.g. https://graph.facebook.com/?id=http://stackoverflow.com
) and routing it to the view?
Upvotes: 2
Views: 1472
Reputation: 47367
You probably should take a quick run through the guides: http://emberjs.com/guides/
http://emberjs.jsbin.com/ajocUPa/1/edit
App.IndexRoute = Ember.Route.extend({
model: function() {
return $.getJSON('https://graph.facebook.com/?id=http://stackoverflow.com');
}
});
or even less code
http://emberjs.jsbin.com/ajocUPa/2/edit
Upvotes: 3