I have the following jQuery snippet:
jQuery(document).mouseup(function (e)
{
var container = jQuery('.dropDown');
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
}
});
Which hides an element if I click outside it.
I want to do the same thing using Angular, but I'm not really sure how to achieve it.
What is the Angular way of binding events like this to the document?