lundi 26 janvier 2015

How do I createRecord for a model inside an unrelated route/template in Ember.js?

Say currently I have a route and template called Newsfeed. This is where all the newsfeed items are currently displaying.


However, if I want to include a text field at the top with a submit button, like Facebook's current 'what's on your mind?', with the text field mapping to the Note model, and a separate backend API endpoint, how should I do it?


I've tried using controllerFor inside the Newsfeed route to setup the reference to my Note model, and I've tried creating another template within the Newsfeed index template, but it doesn't seem to work.


Any general advice to point me in the right direction would be much appreciated.. thanks!





Aucun commentaire:

Enregistrer un commentaire