Hi there ,
I am having these two errors
-
Uncaught Error: Assertion Failed: Error: Assertion Failed: Your server returned a hash with the key projects but you have no mapping for it
-
Error: Assertion Failed: Your server returned a hash with the key projects but you have no mapping for it
And I don’t know how to solve these. My JsonData Format is like this:
{ “projects”: [{ “project_id”: 1, “project_name”: “AAA” }] }
And the contents in App.js are : App.Router.map(function() { this.resource(‘projects’); });
App.Store = DS.Store.extend({ revision: 12, adapter: DS.RESTAdapter.extend({ url: ‘http://portNum/pathToJsonData’ })
});
App.ProjectsRoute = Ember.Route.extend({ model: function(){ return App.Projects.find(); } });
App.Projects = DS.Model.extend({ project_id: DS.attr(‘integer’), project_name: DS.attr(‘string’) });
And in index.html I am using :
{{#each model}}
<tr><td>
{{project_name}}
</td></tr>
{{/each}}
So,this is it,Please help thanks in advance