im on angular2+ and i have an element that has an active class, such as
<div class="notification active">...</div>
what i need to do is that, if i click/tap on anything except on that div
the active
class should be removed.
similarly to this jquery example: https://codepen.io/vlrprbttst/pen/xOoxWo
i had a hard time figuring out how to add that active class and now i have no idea on what's the approach to remove it, and especially how to typescript the "click anywhere to..." part. :/
i am not interested in detecting if that class is there or not as in this question: remove or add Class in Angular and the main difficulty is not removing the class i guess, but the "click anywhere to remove it" part.
any help is greatly appreciated