Thursday, December 31, 2015

Broadcast and Emit in angularjs

In Angular $broadcast() service is always used to propagate event to all of his child controller and it’s registered parent $rootscope.scope listeners.  

  $rootScope.$broadcast('SummaryEvent', {
                priority: priority               
            });




$on() service is used to listen on any given type of event raised by $broadcast and $emit
   $scope.$on(''SummaryEvent'', function (event, args) {
Vm.priority=args.priority
        });



AngularJs  $broadcast () , $on() and $emit()
AngularJs  $broadcast ()  and  $on()  



$emit service is similar to $broadcast but it is used to propagate event to upwards through the scope hierarchy and notify to the registered $rootScope.Scope listeners

AngularJs  $broadcast () , $on() and $emit()
AngularJs  $on() and $emit()

1 comment:

Akhil C said...

This post will be very useful to us....i like your blog and helpful to me..
Angularjs 2 Development Company in India

SQL Server - Identify unused indexes

 In this blog, we learn about the index usage information (SYS.DM_DB_INDEX_USAGE_STATS) and analyze the index usage data (USER_SEEKS, USER_S...