I import a component from external module which have a button.
On button click it does a console.log('test');
So it display 'test' in my console.
It's an external module so i can't access the code of this component. However i know the id of the button element. id='idtest'
.
I'd like to open a confirm modal when i click on this button and execute the console.log('test')
only if i click on 'ok' button and if i don't confirm, event does not happen.
Every solution, pure js or angular are appreciated.
Ever tried getting the element by id, add onclick and eventlistener and call event.stopPropagation()