【发布时间】:2013-12-18 00:49:07
【问题描述】:
我想编辑用户。我正在关注本教程:http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/
我在user.hbs 中有一个按钮来编辑用户:
<button {{action "edit"}}>Edit</button> 及下面是{{outlet}}
当我点击它时,我被定向到/index.html#/users/4/edit,但我的user.edit.hbs 模板没有显示
这里是userEditRoute.js:
App.UserEditRoute = Ember.Route.extend({
model: function(){
return this.modelFor('user');
}
});
还有userController.js:
App.UserController = Ember.ObjectController.extend({
actions: {
edit: function(){
this.transitionToRoute('user.edit');
}
});
为什么user.edit.hbs 不显示?
【问题讨论】:
-
您是否在使用一些构建工具,例如:ember 应用套件、ember 工具等?
标签: javascript ember.js ember-data handlebars.js