【问题标题】:Assertion Failed, ember routes with dynamic id断言失败,带有动态 id 的 ember 路由
【发布时间】:2014-04-21 20:13:22
【问题描述】:

我尝试使用 ember 构建 Web 应用程序,我使用带有 :post_id 的路由模型,但这不起作用: http://www.wilhelminaschool.eu/app2/#posts 工作并显示一个列表,但 指向#post/11330 的链接不起作用,错误:断言失败?

我做错了什么?

【问题讨论】:

    标签: ember.js routing


    【解决方案1】:

    将您的路由器映射更改为

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多