Want to load an object from an id in an Ember View? Use the below code and only after the view is inserted the didInsertElement hook gets executed which gets the required user.
1 2 3 4 5 6 7 8 9 10 | {{#each id in listOfIds}} {{view App.UserThumb idBinding="id"}} {{/each}} App.UserThumb = Ember.View.extend({ didInsertElement: function() { var authorId = this.get('id'); User.find(authorId, function(user) { view.set('content', user); } ); } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.