title: Modifying parent scope for Special Variables within Angular expressions
body: <p>I'm developing a colorpicker with Angular and trying to incorporate some of the ideas I've seen elsewhere in order to write the expression that will be called whenever a user picks a color.</p>
  
  <pre><code>&lt;color-picker on-pick='something($color)'&gt;&lt;/color-picker&gt;
  </code></pre>
  
  <p>I've noticed that all of the built in directives use this style of scope binding, rather than say for instance, passing the function straight onto the scope.</p>
  
  <pre><code>&lt;color-picker on-pick='something'&gt;&lt;/color-picker&gt;
  </code></pre>
  
  <p>An example of this style is ngRepeat:</p>
  
  <pre><code>&lt;li ng-repeat='item in items' ng-bind='$index'&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I understand that the <code>something($color)</code> expression will evaluated with the parent scope, rather than the scope of the directive itself, meaning that the <code>$color</code> property would have to be available on the parent scope in order to be correctly evaluated.</p>
  
  <p>However, if the directive has an isolate scope, it won't see the parent. Even if it could, I don't want to clobber a <code>$color</code> variable into that scope.</p>
  
  <p>In a similar vein, I've seen somewhere that a scope binding using <code>&amp;prop</code> will evaluate the expression within the parent scope, rather than the directive's scope. However, if that is the case, how can it be possible to make calls like <code>on-pick='something($color)'</code> as the $color property comes from the directive's scope, whereas the <code>something</code> function would be on the parent scope?</p>
  
  <p>The Angular documentation for ngRepeat refers to these variables as 'special variables', however a look at the source shows that they are assigned onto a scope generated from some system of block mapping. I struggled to follow past there at a quick glance.</p>