相关疑难解决方法(0)

如何消除ember.js中嵌套路由的歧义?

我有两个资源都具有相同的子资源:

App.Router.map(function() {
  this.resource('post', function() {
    this.resource('comments', function() {
      this.route('new');
    });
  });

  this.resource('product', function() {
    this.resource('comments', function() {
      this.route('new');
    });
  });
});
Run Code Online (Sandbox Code Playgroud)

问题是,ember路由器只根据当前和父路由构建路由对象的名称,而不是整个层次结构.因此,它会尝试路线都/posts/:id/comments/new/products/:id/comments/newApp.NewCommentRoute对象.我该怎么做才能解决这个问题?

这篇文章改编自GitHub问题.

javascript ember.js ember-router

6
推荐指数
1
解决办法
907
查看次数

标签 统计

ember-router ×1

ember.js ×1

javascript ×1