I have ng-click event on parent DIV, which calls function. I want this event to be triggered only if the parent div is clicked, not if the child div is clicked. So, if the area clicked inside parent covers child div, event should not trigger. Now, click on div2 triggers event.
My example is here on code pen
Html structure:
<div id="div1" class="div1" ng-app="appModule" ng-controller="appController" ng-click="test();">
<div id="div2" class="div2">
</div>
</div>
There is div1 (parent div) and div2 inside this div (child div). I've put ng-click on parent div, because I need it to be triggered everywhere on the parent, only on the div2 not. How to achieve this with angular?