How pass 2 parameters to EventEmitter in Angular?

If you look at the EventEmitter emit method @ angular.io, it can only take a single parameter of type T

emit(value?: T)

Since only a single parameter is allowed, consider passing it as an object in emit method.

In the snippet below, make & name variables are holding their respective values:

this.addModel.emit({make: make, name: name});
//shorthand is below
this.addModel.emit({make, name});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)