问题
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