Answer the question
In order to leave comments, you need to log in
How to intercept angular click event with pure javascript?
There is a frontend, part of which is implemented in angular. There is a view tag in html , inside it everything is drawn by Angular, incl. and view buttons
Task: use pure javascript to intercept clicks on such buttons. You don’t need to change the logic, let Angular work as expected, you just need to fix the click on the button and work it out. Is this even possible? <blabla></blabla>
<button class="apply-button">Apply</button>
Answer the question
In order to leave comments, you need to log in
document.addEventListener('click', function(e) {
const t = e.target;
if (t.matches('button.apply-button') && t.closest('blabla')) {
// ...
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question