我有一个组件 MyComp,我想将一个函数作为参数传递给它。更准确地说,我想做这样的事情:
飞镖组件文件:
@NgComponent(
selector: 'mycomp',
publishAs: 'ctrl',
map: const {
'myfunc' :'=> myfunc'
}
)
class MyComponent {
Function myfunc;
....
myfunc();
}
html:
<mycomp myfunc="ctrl.myfunc"></button-list>
问题是组件中的 myfunc 为空。我错过了什么吗?我怎样才能做到这一点?