【发布时间】:2014-04-21 20:13:22
【问题描述】:
我尝试使用 ember 构建 Web 应用程序,我使用带有 :post_id 的路由模型,但这不起作用: http://www.wilhelminaschool.eu/app2/#posts 工作并显示一个列表,但 指向#post/11330 的链接不起作用,错误:断言失败?
我做错了什么?
【问题讨论】:
我尝试使用 ember 构建 Web 应用程序,我使用带有 :post_id 的路由模型,但这不起作用: http://www.wilhelminaschool.eu/app2/#posts 工作并显示一个列表,但 指向#post/11330 的链接不起作用,错误:断言失败?
我做错了什么?
【问题讨论】:
将您的路由器映射更改为
App.Router.map(function() {
this.route("page");
this.route("menu");
this.resource('posts', function(){
this.resource('post', { path: '/:post_id' });
)};
this.route("index", { path: "/" });
this.route("cat");
this.route("foto");
});
【讨论】: