AngularJs: Detect Click on Parent scope from isolated directive

146 views Asked by At

Hi I have an isolated directive. I want to detect if the scope has been clicked on using $scope.$parent object. Is this possible. I am trying to listen to a click event on a parent scope using the scope object variable...is this possible?

1

There are 1 answers

0
DD84 On

In this particular instance, you would want to use $scope.$on to listen to the event occurring.

Todd Motto provides a great example to understand this in more detail.

https://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subscribing/