jeudi 26 février 2015

Model not found on ObjectController

I have an ArrayController (documents) which displays a list of ObjectsControllers (document) for its content. Currently, when I call this.model.save() or this.model.rollback() on a document controller , I get an undefined error message. Strangely however, each document controller is correctly displaying the values from its model in its template.


My ArrayController template (Documents):



{{#each document in controller}}
{{render "document" document}}
{{/each}}


The reason I use render is because I need a separate view for each document controller. Why is the model missing from each document's object controller please?


Update


I have replaced the "each" line above as follows:



{{#each document in model}}


The model is now available, but now the sorting I have put in place on the my ArrayController using the sortProperties and sortAscending properties are no longer taking effect.





Aucun commentaire:

Enregistrer un commentaire