Sharing Top Content from the Angular-sphere.

Understanding Angular’s $scope and $rootScope event system $emit, $broadcast and $on @toddmotto

  • $emit ( ‘myCustomEvent’ , ‘Data to send’ ); // firing an event downwards $scope .
  • The Angular event system is brilliant, it makes things flawless and easy to do (as you’d expect!
  • For those who are new to Angular and haven’t used or seen $emit , $broadcast or $on , let’s clarify what they do before we look at $scope and $rootScope event and scope relationships and how to utilise the event system correctly – as well as understand what’s really going on.

Read the full article, click here.

@tsmrgrg: “Check it out Angular Folks… #angularjs @angularjs #javascript”

Angular’s $emit, $broadcast and $on fall under the common “publish/subscribe” design pattern, or can do, in which you’d publish an event and subscribe/unsubs…

Understanding Angular’s $scope and $rootScope event system $emit, $broadcast and $on @toddmotto

Comments are closed, but trackbacks and pingbacks are open.