【发布时间】:2015-10-22 04:02:41
【问题描述】:
我有一个嵌套的路由结构:
//router.js
this.route('maps', { path: '/maps' }, function () {
this.route('show', { path: '/:id' }, function () {
this.route('display', { path: '/display' }),
this.route('layers', function () {
this.route('create')
})
});
});
我的理解是,我应该有一条路线 maps.show.display,它应该采用单个动态段,例如 maps/1/display
但是,当我去过渡或链接到这个即:
//maps route
afterModel: function (resolvedModel) {
var newestFlight = resolvedModel.content[0];
var newestMap = newestFlight.get('map');
this.transitionTo('maps.show.display', newestMap);
}
或
{{#link-to 'maps.show.display' id}}show map{{/link-to}}
我得到一个错误:
Error while processing route: maps.index More context objects were passed than there are dynamic segments for the route: maps.show.index
更奇怪的是,这条路由接受了相同的动态段,而它只是 maps/display,所以我不明白为什么嵌套它会进一步破坏它。
任何关于我做错了什么的想法将不胜感激
编辑:有趣的是,this awesome tool
似乎也同意,如果您在此处发布我的路线,我应该在此处有一个动态段
【问题讨论】: