title: What are $ctrl in angularjs? when to use $ctrl vs $scope on view?
body: <p>In example <code>$ctrl</code> is used on view </p>
  
  <pre><code>&lt;b&gt;Heroes&lt;/b&gt;&lt;br&gt;
  &lt;hero-detail ng-repeat="hero in $ctrl.list" 
               hero="hero" 
               on-delete="$ctrl.deleteHero(hero)" 
               on-update="$ctrl.updateHero(hero, prop, value)"&gt;
  &lt;/hero-detail&gt;
  </code></pre>
  
  <p>When to use <code>$ctrl</code> and when to use <code>$scope</code> for interacting with view?</p>
  
  <p><a href="https://docs.angularjs.org/guide/component" rel="nofollow noreferrer">https://docs.angularjs.org/guide/component</a></p>