title: Angular ng-view access controller scope
body: <p>I'm trying to access a controller inside ng-view. <a href="https://docs.angularjs.org/tutorial/step_07" rel="nofollow">Routing &amp; Multiple Views</a> suggests simply adding the controller as a parameter of the passed object. So I have:</p>
  
  <p><strong>inside my app.config:</strong></p>
  
  <pre><code>$routeProvider.when('/',{
          templateUrl: 'ng-view/index.html',
          controller: 'HomeController'
      });
  </code></pre>
  
  <p><strong>the controller I'm trying to use:</strong></p>
  
  <pre><code>app.controller('HomeController', function($scope){
      $scope.hello = "something";
  });
  </code></pre>
  
  <p><strong>ng-view/index.html:</strong></p>
  
  <blockquote>
    <p>{{hello}}</p>
  </blockquote>
  
  <p>This gives me: <code>SyntaxError: Unexpected token h</code></p>
  
  <p>Now I know wrapping the variable in a div with ng-controller="homecontroller" works, but surely that defeats the point of passing the controller via the route provider?</p>
  
  <p>Am I going about accessing the scope wrong?</p>