title: Why is the variable set in ng-init undefined in $scope in AngularJS?
body: <p>I have a variable I'm setting in my view with <code>ng-init</code> which I am then trying to access in my controller. When I try to access it however, I'm getting an <code>undefined</code>.</p>
  
  <p>Relevant pieces of code:</p>
  
  <p>My view:</p>
  
  <pre><code>&lt;div ng-controller="MyCtrl"&gt;
    &lt;div ng-init="pageTitle = 'kittens'"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>var MyCtrl;
  
  MyCtrl = function($scope) {
    return console.log($scope.pageTitle);
  };
  </code></pre>
  
  <p><a href="http://jsfiddle.net/andrewboni/WUzr9/3/" rel="noreferrer">JSFiddle</a></p>
  
  <p>What am I missing here?</p>