One can use Output()
decorator to emit the event from the child component so that the parent component can catch it. What I need is to catch an event emitted by
If you find you have to pass certain events through make sure to be consistent and come up with a naming strategy. For instance I like to add raise
to the beginning of the method name if the only thing that method does is to re-raise an event.
eg.
(paypalTokenized)="raisePaypalTokenized($event)"
and in the ts
file:
@Output('paypalTokenized')
public paypalTokenizedEmitter = new EventEmitter();
// PayPal tokenized
public raisePaypalTokenized(payload: PayPalTokenizedPayload)
{
// no other logic here!
this.paypalTokenizedEmitter.emit(payload);
}
This means I can tell immediately that the event is being passed through with no further action.