title: Why do we use $rootScope.$broadcast in AngularJS?
body: <p>Tried to find some basic information for AngularJS <code>$rootScope.$broadcast</code>, But the AngularJS documentation doesn't help much. In easy words why do we use this?</p>
  
  <p>Also, inside John Papa's <a href="http://www.johnpapa.net/hot-towel-angular/" rel="noreferrer">Hot Towel</a> template there is a custom function in the common module named <code>$broadcast</code>:</p>
  
  <pre><code>function $broadcast() {
      return $rootScope.$broadcast.apply($rootScope, arguments);
  }
  </code></pre>
  
  <p>I did not understand what this is doing. So here are couple of basic questions:</p>
  
  <p>1) What does <code>$rootScope.$broadcast</code> do?</p>
  
  <p>2) What is the difference between <code>$rootScope.$broadcast</code> and <code>$rootScope.$broadcast.apply</code>?</p>