为什么我的模板没有渲染 [英] Why aren't my templates rendering

查看:19
本文介绍了为什么我的模板没有渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 ember 的最新过渡内容创建了一些随机视图,并且网点没有渲染.它说它正在转换,但输出窗口中没有显示任何内容.(请注意,如果我完全删除路线,这会起作用)

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)

这里是:

jsfiddle 示例

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?

推荐答案

你的 route 正在扩展 Router!应该是,

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);
    }
});

更新小提琴 此处.

这篇关于为什么我的模板没有渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆