我找不到如何链接到我的Ember应用程序的根路径.
我试过:{{link-to’index’}}首页{{/ link-to}},但在我的控制台中我收到异常:断言失败:尝试链接到路由“索引”失败(也尝试’index.index’).路由器在其可能的路由中没有找到’index’:’loading’,’error’,’start.loading’,’start.error’
我试过:{{link-to’index’}}首页{{/ link-to}},但在我的控制台中我收到异常:断言失败:尝试链接到路由“索引”失败(也尝试’index.index’).路由器在其可能的路由中没有找到’index’:’loading’,’error’,’start.loading’,’start.error’
同样的,当我尝试{{link-to’application’}}
这是我的路由器
- App.Router.map(function() {
- this.resource('start',{ path: '/start' },function() {
- //.. sub routes ..
- });
- this.resource('intro',{ path: '/' },function() {
- // ...
- });
- this.route('login')
- });
解决方法
根据您使用的版本,它用于仅支持索引,现在应用程序也可以连接到根目录.
- {{link-to 'Back to Home' 'application' }}
- {{link-to 'Back to Home 2' 'index' }}