0

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?

4
  • is it possible to make a plunker Commented Jun 23, 2017 at 6:36
  • Why don't just pass that object from parent scope to the isolated scope? Commented Jun 23, 2017 at 6:45
  • @neptune how do i do that? Commented Jun 23, 2017 at 6:47
  • @flexxxit see here: weblogs.asp.net/dwahlin/… Commented Jun 23, 2017 at 6:49

1 Answer 1

0

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/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.