Event object and parameters in Angular template

You can combine the $event variable with other parameters. The order does not matter - Angular will insert the event object into the parameter where $event is written.

Let's look at an example. We'll pass a string and an object with an event as parameters:

app/app.component.html<button (click)="show('eee', $event)">
  button
</button>

Let's catch what was passed in the parameters of the component class method:

app/app.component.tsexport class AppComponent {
  public show(arg: string, event: MouseEvent): void {
    console.log(event);
  }
}
Задание 1

Catch the passed parameters in variables:

app/app.component.html<button (click)="show('eee', 123, $event)">
  button
</button>