【发布时间】:2013-12-27 21:42:47
【问题描述】:
我正在尝试从这里 Original 部分复制用于学习清酒的示例
我的 jsbin 是 MY JSBIN 我的帖子路线是
App.PostsIndexRoute = Ember.Route.extend({
model: function() {
return this.modelFor('posts');
}
});
App.PostsRoute = Em.Route.extend({
model: function(){
return this.store.findAll('post');
}
});
和我的标签路由完全一样。
App.TagsIndexRoute = Em.Route.extend({ model:function(){ 返回 this.modelFor('tags'); } });
App.TagsRoute = Em.Route.extend({ model: function(){ 返回 this.store.findAll('tag'); } });
如果我的数据模板名称是 data-template-name="tags",我可以显示数据 我无法使用 data-template-name="tags/index" 显示数据
我的路由器地图是这样的
App.Router.map(function() {
// put your routes here
this.route('about');
this.resource('posts',{path:'/posts'},function(){
this.route('post',{path:':id'});
});
this.resource('tags',{path:'/tags'});
});
它只是默默地失败,没有错误消息。如果在 IndexRoute 我从 transitionTo('tags') 更改为 transitionTo('posts') 一切正常,不知道我哪里出错了。
【问题讨论】:
标签: ember.js