Use $broadcast(), $emit() and $on() in AngularJS
Posted by: Bipin Joshi.com :: Thoughts on .NET, Life, Yoga and more,
on 18 May 2015 |
View original | Bookmarked: 0 time(s)
AngularJS applications may need to communicate across the controllers. Such a communication might be needed to send notifications or to pass data between the controllers. Although there can be different approaches to achieve this goal, one that is readily available is the event system of $scope and $rootScope. Both of these objects - $scope and $rootScope - support three methods namely $broadcast(), $emit() and $on() that facilitate event driven publisher-subscriber model for sending notifications...