I have sort of this in a directives link function
angular.module('app', [])
.directive('myDirective', function($document){
return {
link: function($scope, element){
$document.on('click', function(event){
var childElementWasClicked = element.find(event.target).length > 0;
if(childElementWasClicked) return;
$scope.hide();
});
}
}
}
So I get this doesn't work beacuse of jquery lite's limitations, but I would really like to solve this without using jquery (full). I read this where they seem to solve finding with classes but I can't figure out how to solve it when having a element object like the event.target
.
All help would be appreciated!