top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is use for emit and broadcast in Angular.Js?

0 votes
399 views
What is use for emit and broadcast in Angular.Js?
posted Dec 31, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

AngularJS provides $on, $emit, and $broadcast services for event-based communication between controllers.

$emit
It dispatches an event name upwards through the scope hierarchy and notify to the registered $rootScope.Scope listeners.

$broadcast
It dispatches an event name downwards to all child scopes (and their children) and notify to the registered $rootScope.Scope listeners.

answer Jan 31, 2018 by Aarati Mahajan
...