余烬。路线。在嵌套路由中相同的名称,路由查找 [英] Ember. Routes. The same name in nested routes, routes lookup

查看:97
本文介绍了余烬。路线。在嵌套路由中相同的名称,路由查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否不可能有相同名称的嵌套路由?例如:

Is it impossible to have nested routes with the same names? For example:

// url - category/12345/card/id99
this.resource('category', { path: '/category/:category_id' }, function () {
    this.resource('card', { path: 'card/:card_id' });
});

// url - semantic/books/card/id99
this.resource('semantic', { path: '/semantic/:semantic_id' }, function () {
    this.resource('card', { path: 'card/:card_id' });
});

当我调用 transitionTo('card')路由器查找最后一个版本路由'card'

When I call transitionTo('card') router lookups only last version of route 'card'

看起来路由器有普通路由列表,路由名称相同,路由名称不断覆盖最后。

Looks like router has plain routes list and routes with the same names constantly overriden by last.

我错了?

推荐答案

是的,对于v.1版本是不可能的。

yes, for version v.1 it's impossible.

这篇关于余烬。路线。在嵌套路由中相同的名称,路由查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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