2

I have seen similar questions , But they are dealt by marking the event with defaultPrevented:yes to tell the children not to process the event.Is there any way we can stop the propagation of the event down the scope hierarchy?

My scenario is that the controller broadcasting the event have many child scopes out of which only the first child scope needs the event.So taking performance it to consideration i was trying to stop the event propagation at the first level itself.The scenario is illustrated in this fiddle

Is that possible?

Community
  • 1
  • 1
Divya MV
  • 2,021
  • 3
  • 31
  • 55

1 Answers1

1

You can't prevent a $broadcast from propagating down the child scopes. instead you can use event.preventDefault() in child controller listeners to let them ignore this broadcast event.

iamntg
  • 29
  • 6