title: Angularjs does not load scripts within ng-view
body: <p>I had some scripts specific to a view. However, the script does not seem to execute when angularjs loads the view. </p>
  
  <p><strong>Index.html</strong></p>
  
  <pre><code>&lt;html&gt;
    &lt;body ng-app="adminApp"&gt;
  
      &lt;div ng-view=""&gt;&lt;/div&gt;
  
      &lt;script src="bower_components/angular/angular.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/app.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/controllers/main.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Main.html</strong> - loads under ng-view</p>
  
  <pre><code>hello world
    &lt;script&gt;
  
      alert('Hello, John!')
  
    &lt;/script&gt;
  </code></pre>
  
  <p>In this example, when the page load, I see a basic hello world printed on the website. However, I do not get any pop up saying "Hello, John". </p>
  
  <p>Any idea why I cannot load scripts specific to a certain view? </p>
  
  <hr>
  
  <p><em>Extra info</em>
  <strong>app.js</strong></p>
  
  <pre><code>'use strict';
  
  angular.module('adminApp', [])
    .config(function ($routeProvider) {
      $routeProvider
        .when('/', {
          templateUrl: 'views/main.html',
          controller: 'MainCtrl'
        })
        .otherwise({
          redirectTo: '/'
        });
    });
  </code></pre>
  
  <p><strong>controllers/main.js</strong></p>
  
  <pre><code>'use strict';
  
  angular.module('adminApp')
    .controller('MainCtrl', function ($scope) {
      $scope.awesomeThings = [
        'HTML5 Boilerplate',
        'AngularJS',
        'Karma'
      ];
    });
  </code></pre>