I wrote a function with $event in Angular2 and through click event from template class it's working fine. But I am trying to call that function manually, So for that how to pass a event value through function.
This is my function:
onActionChange($event) {
// alert($event.target.value);
const selectedAction = parseInt($event.target.value);
}
This is how i am trying to call function: onActionChange('7');
Here I am getting error like:
TypeError: Cannot read property 'value' of undefined