I’m building an Ember app within the NodeWebkit framework. When I started it I decided to use plain Ember.Object for my Models:
App.Person = Ember.Object.extend({
First: null,
Last: null
});
Then I have a loadData method which reads a JSON file using Node, parses it, and returns the data to the page for Ember to iterate over it.
Now I’d like to start using Ember Data. When I implement the model hook in my route:
App.PeopleRoute = Ember.Route.extend({
name: 'people',
model: function(){
// debugger;
return this.store.find('person');
}
});
The AJAX call fails because it’s pointing at file:///people
instead of a legitimate resource. I know that I can specify a URL in my Adapter, which currently looks like this:
App.ApplicationAdapter = DS.RESTAdapter.extend({
namespace: 'api/1'
});
But that merely pushes the issue down the chain. Is there any way I can reference a file URL relative to my application in which Ember Data could access this JSON file?
I should say that the current approach I’m using works perfectly. The main reason I’m wanting to move to Ember Data is so that I can experiment with the new testing methods.
Would love some advice and input.