我看了看这个:
Ember.js 未捕获的错误:没有处理事件“addSite”
和
但不知道我的错在哪里,我有:
路由.js:
Todos.Router.map(function () {
this.resource('todos', { path: '/' }, function() {
this.route('active');
this.route('completed');
});
});
Todos.TodosRoute = Ember.Route.extend ({
model: function () {
return this.store.find('todo');
}
});
Todos.AboutRoute = Ember.Route.extend({
model: function() {
return [{rate:100,qnty:1},{rate:101,qnty:1},{rate:102,qnty:1},{rate:103,qnty:1},{rate:104,qnty:1}];
}
});
然后在 index.html
<script type="text/x-handlebars" data-template-name="about">
{{#each}}
{{input value=qnty min="1" max="9999999" type="number" disabled=true}}
<button {{ action "increase" this}}>
Up
</button>
{{/each}}
</script>
然后在 about_controller.js 中:
Todos.AboutController = Ember.ArrayController.extend({
actions: {
increase: function(item) {
var qnty = (Ember.get(item,'qnty'));
console.log(qnty);
Ember.set(item,'qnty',++qnty);
}
}
});
我也收到错误:未捕获的错误:没有处理事件“增加”。
有人可以帮忙吗?谢谢