title: AngularJS nested controllers - How to call external controller's functions
body: <p>I'm following an exercise in a book, so I don't know if I'm doing any mistake.
  I have two controllers both with a function with same name:</p>
  
  <pre><code>app.controller('externalController', ['$scope', function(scope){
    scope.aFunction(){
    //Some code...
    };
  }]);
  
  app.controller('innerController', ['$scope', function(s){
    s.aFunction(){
    //Some code...
    };
  }]);
  </code></pre>
  
  <p>In the book, the function of the external controller is calles in this way:</p>
  
  <pre><code>&lt;div ng-controller="externalController as Ext"&gt;
    &lt;div ng-controller="innerController"&gt;
      &lt;button ng-click="Ext.aFunction()&gt;Button&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>this doesn't work for me, can anyone tell me if I'm doing any mistake or if there's something wrong in the code?
  Thanks a lot.
  mauro</p>