I have installed the following scaffold for my amber app.
window.App = Ember.Application.create ({}); App.Router.map (function () {this.resource ('coach', function) {this.resource ('coach', {path: "/: person_id"});});}); App.ApplicationAdapter = DS.FixtureAdapter.extend ({}); App.Person = DS.Model.extend ({fname: DS.attr ('string'), lname: DS.attr ('string'), game: DS.attr ('string'), bio: DS.attr ( 'String'), coach: DS ('boolean'), athlete: DS ('boolean')}); Ep. Person.ficturer = [{id: 10, fname: 'Johnny', Lin: 'Batman', game: 'coach luge', bio: 'blah, blah, blah', coach: true, athlete: true] , {Id: 11, fname: 'Jimmy', lname: 'Falcon', game: 'cycling', bio: 'yada, yada, yada', coach: wrong, athlete: true}];
I am trying to set a path to filter the person's model and only return the coach. Just to make sure that I can access the data, I've just used FindAll on a person model.
App.CoachesRoute = Ember.Route.extend ({Model: function ()} .store.findAll ('person');}});
Now though, I am trying to apply the detailed filter method at the bottom of the page.
App.CoachesRoute = Ember.Route.extend ({Model: function () {var store = this.store; return store.filter ('coach', {coach: true} , Function (coach) {return coaches.get ('isCoach');})}}});
The coach route is not working perfectly with the new route and the old one has commented. When I am using the Amber Chrome extension and when it reacts with the console, while loading the route, Thank you in advance for your help. The error message is in place - no one is error: error: no model was found for 'coach'. Apparently the route is not working, especially the model. There is no joke, is not it? What am I missing in my filter model route?
CoachModel
. I think you need to:
app. Cocus root = amber way. Extension ({Model: Work} {var store = this.store; return store.filter ('person', {coach: true}, function (coach) {return coach.gate ('iacoc');}); });
Comments
Post a Comment