2016-05-16 113 views
0

当前仪表板网址为“reporting/questionnaire。”。用户通常会忘记输入完整的“/报告/问卷”,最终只能通过“/ reporting”进行搜索。EmberJS - 将父路径重定向到其嵌套的子路径

这当前设置为嵌套路线。

Router.map(function() { 
    this.route('reporting', function() { 
    this.route('questionnaires'); 

任何人都知道如何将父路径'/ reporting'重定向到其嵌套子节点'reporting/questionnaire'?

回答

0

想通了!二手EmberJS重定向插件为灰烬,CLI:https://github.com/thoov/ember-redirect

这个代码是所有花:

var Router = Ember.Router.extend({ 
    location: config.locationType, 

    redirects: { 
    'reporting.index' : 'reporting.questionnaires' 
    } 
});