Rendering resolved promise value in Ember handlebars template
问题 Is there a good way to render the result of a promise in a handlebars template? For example, I have the following model: App.TopicItem = DS.Model.extend({ topic: DS.belongsTo('topic'), paddedPosition: function() { return this.get('topic.course.lessons'). then(function(lessons) { return lessons.indexOf(topicItem); }). then(function(index){ var position = index; if (position < 0) { return; } position = position + 1; return (position < 10 ? $.rjust(position, 2, '0') : position.toString()); }); }