mardi 14 avril 2015

Ember -- "No model was found" in a route that

I have a route that looks like root.index.branch.index.leaf.index and am using a reflexive model defined in root that looks like



var model = DS.Model.extend({
name: DS.attr('string'),
children: DS.hasMany('model', {inverse: null}),
});


When I try to transition to the above route, I get an error: "Error while processing route: root.index.branch.index.leaf.index" "No model was found for 'branch'"


But the data I have in 'branch' are some of the children of the model defined in 'root'. And I want the data in 'leaf' to be some children of the data in 'branch'.


Basically I only want to explicitly define a model in 'root' and navigate down the tree in each nested route, but Ember is insisting I explicitly define a model in 'branch' to show anything in 'leaf'.


I've done some Googling but I'm stuck. Any help in resolving this is appreciated.





Aucun commentaire:

Enregistrer un commentaire