We have a template declaration that invokes the components log
function and we wish to pass different values to log()
.
Approach
Simply pass the function argument, as is done in the below demo like this:
<button (click)="log('hola!')">Log Hola!</button>
<button (click)="log('hello!')">Log Hello!</button>