Reputation: 13
i have a div with ng-click inside that div is a button, when i click the button the function bind with ng-click always execute but not the button, how to just execute the ng-click of button only
<div ng-click=redirectToPage()>
...
<button><button>
</div>
Upvotes: 0
Views: 54
Reputation: 3618
You can use stopPropagation()
method to prevent the event from bubbling up.
Read more: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation
Check demo: DEMO
Upvotes: 3