Pass parameters with EventEmitter

Source: https://stackoverflow.com/questions/35390765/pass-parameters-with-eventemitter


@Output() stopSort = new EventEmitter();
EventEmitter supports one argument, which is passed as $event to your event handler.
Wrap your parameters in an event object when you pass it to emit:
this.stopSort.emit({ event:event, ui: ui });
Then, when you handle the event, use $event:
stopSort($event) { 
  alert('event param from Component: ' +$event.event);
  alert('ui param from Component: ' + $event.ui);
}

Không có nhận xét nào:

Is it okay to use both fetchpriority="high" and loading="eager" in img tag?

 https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...