4
为什么不点击下面模板中描述的按钮按预期工作? This blog post does the exact same thing。ngClick事件在Angular 1.5.5组件中未触发
'use strict';
angular.module('core').component('foo', {
bindings: {
items: '<',
},
controller: function() {
function fire() {
console.log('hello');
}
},
template: "<button type='button' ng-click='$ctrl.fire();'>Test</button>"
});
编辑:增加了更加清晰的问题
*“为什么不按预期工作?”*。没有人知道你期望什么,你会得到什么。 – dfsq
代码的标题和上下文是否不足以推断我希望将消息记录到控制台? – sean
这是最好在帖子后面解释它。像我例如错过了标题。无论如何,Amir已经正确回答了。 – dfsq