ember.js – 如何链接到根路由的应用程序

前端之家收集整理的这篇文章主要介绍了ember.js – 如何链接到根路由的应用程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我找不到如何链接到我的Ember应用程序的根路径.
我试过:{{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' }}

http://emberjs.jsbin.com/OxIDiVU/188/edit

原文链接:https://www.f2er.com/js/152715.html

猜你在找的JavaScript相关文章