So there are a number of examples of Ember.js online but looking at this one for instance:
http://matthewlehner.net/get-started-with-ember-js-in-5-minutes/
It ends up with the following route object:
Test1.ApplicationRoute = Ember.Route.extend({
// admittedly, this should be in IndexRoute and not in the
// top level ApplicationRoute; we're in transition... :-)
model: function () {
return ['red', 'yellow', 'blue'];
}
});
As a first step I would like to replace that model with a JSON request, so seeing some examples online I tried this:
return $.getJSON('/colors.json');
where colors.json is a file:
['red', 'yellow', 'blue']
I have tried some variations on this but it always gives me this error in my browser: "Error while loading route: undefined"
Can someone give me an idea of how to get this working?
See http://jsbin.com/lususavo/4/ for an example of the "before" state. How do I get that to work with getJSON?