Why aren't my templates rendering

2019-01-28 14:59发布

问题:

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.