<!DOCTYPE html> <p>The rootScope's favorite color:</p> <div ng-controller="myCtrl"> <p>The scope of the controller's favorite color:</p> </div> <p>The rootScope's favorite color is still:</p> <script> <p>Notice that controller's color variable does not overwrite the rootScope's color value.</p> |
The rootScope's favorite color: {{color}}The scope of the controller's favorite color: {{color}}The rootScope's favorite color is still: {{color}}Notice that controller's color variable does not overwrite the rootScope's color value. |