如何绑定到组件模板内第三方组件的动作(HBS)
问题描述:
我使用的余烬,字体真棒,如何绑定到组件模板内第三方组件的动作(HBS)
https://github.com/martndemus/ember-font-awesome
当我尝试绑定的点击操作处理程序组件(见下面的代码)的动作永远不会被触发,
内我的组件
{{fa-icon "times" (action "paramRemove" param on="click")}}
如何我可以在不重新打开组件的情况下将动作绑定到组件上吗?
答
您需要使用动作助手来定义点击属性值。 参考 - https://github.com/martndemus/ember-font-awesome#actions
{{fa-icon "times" click=(action "paramRemove" param)}}