Why aren't my templates rendering

拈花ヽ惹草 提交于 2020-01-10 05:27:26

问题


I've created some random views with the latest transition stuff from ember and the outlets aren't rendering. It's saying it's transitioning, but nothings showing up in the output window. (Note this works if I completely remove the routes)

Here it is:

jsfiddle to example

App.PageRoute = Em.Router.extend({
    model: function(params, transition){
        return App.Page.find(params.page_id);
    }
});

Does it have to do with promises? Am I supposed to be returning a promise instead of the actual model?


回答1:


You're route is extending the Router! It should be,

App.PageRoute = Em.Route.extend({
    model: function(params, transition){
        return App.Page.find(params.page_id);
    }
});

Updated fiddle here.



来源:https://stackoverflow.com/questions/17607675/why-arent-my-templates-rendering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!