$event in AngularDart 1.0 is not available anymore - what is the alternative?

≡放荡痞女 提交于 2019-12-11 07:42:42

问题


Pre AngularDart 1.0 I used something like
<button on-click="handleClearClicked($event)">Clear</button>

$event is not available anymore. I get

...has no instance getter '$event'. NoSuchMethodError: method not found: '$event'

What is the alternative?


回答1:


Ha - found the answer.

Pre Angular 1.0 it worked with on-click now it has to be ng-click

So I changed the sample from above to:

<button ng-click="handleClearClicked($event)">Clear</button>

and voila - $event ist back again.
(not sure if this is a bug or a feature - but anyway, it works)



来源:https://stackoverflow.com/questions/26335260/event-in-angulardart-1-0-is-not-available-anymore-what-is-the-alternative

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!