" UnrecognizedURLError" ember startup probs

时间:2017-01-30 10:24:14

标签: ember.js ember-cli

使用http://localhost:4200/index.html作为基本网址, 需要在我的应用程序加载时路由到仪表板..在router.js中添加仪表板的路径

2 个答案:

答案 0 :(得分:1)

在router.js文件中,

this.route('dashboard', { path: '/' });

这将始终将/路线重定向到仪表板路线。

答案 1 :(得分:0)

您的baseUrl不应指向index.html文件。如果可能的话,它应该只是'/'。这样,您的应用就会在http://localhost:4200/上投放,网址中不需要index.html

如果您希望此路线重定向到/dashboard,请转到routes/application.js并添加以下功能:

didTransition() {
  this.transitionTo('dashboard');
}

这样,当基本路线转换时,它将“重定向”到仪表板。