title: Angularjs controller not working defined in a self invoking function hooked to a module
body: <p>I have a page as follows. The controller is not working. Can someone please suggest me whats wrong?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="demoApp"&gt;
  &lt;head&gt;
      &lt;title&gt;AnjularJs Hello World&lt;/title&gt;
  &lt;/head&gt;
  &lt;body data-ng-controller="CustomerController"&gt;
      &lt;h2&gt;Customers&lt;/h2&gt;
      &lt;div id="Trial"&gt;{{name}}&lt;/div&gt;
      &lt;script src="Scripts/angular.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          (function () {
              alert("Inside Self invoking function. This is popping up.");
              CustomerController = function ($scope) { 
                  alert("Inside controller. But this is NOT popping up");
                  $scope.name = 'HeHe';
              };
              CustomerController.$inject = ['$scope'];
              angular.module('demoApp').controller('CustomerController', CustomerController);
          }());
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Alert inside the controller is not popping. The first alert is popping. Also the div with id="Trial" is not printing the name. </p>
  
  <p>What am I missing?</p>