为什么不点击下面模板中描述的按钮按预期工作? This blog post does the exact same thing
'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>"
});
编辑:为问题添加了更多清晰度
答案 0 :(得分:5)
函数fire
未在控制器上公开。
this.fire = fire;