title: AngularJS Set Value to $scope from Nested Function
body: <p>I'm trying to get a value from a function inside a function:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>  $scope.vm = {};
  
    function myFunc(){
      $scope.vm.hello = 'Hello';
      function myFunction(){
        $scope.vm.world = 'world';
      }
    }
  
    myFunc();
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;p&gt;{{vm.hello}} {{vm.world}}&lt;/p&gt;
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/vfjZR80UOAtcoumtZNUP?p=preview" rel="nofollow">Here's my Plunk</a>.</p>
  
  <p>How can I get this to display "Hello world"?</p>