为什么不单击下面模板中描述的按钮按预期工作?
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>" });
编辑:为问题添加了更多清晰度
解决方法
功能触发器未暴露在控制器上.
this.fire = fire;