title: Initializing angular controller variables
body: <p>I am having an issue where my controller variables are not being initialized correctly as per the controller code.</p>
  
  <p>The controller code is</p>
  
  <pre><code>  angular.module('test')
    .controller('RegisterCtrl', function RegisterCtrl($scope) {
  var vm = this;
     vm.model = {companyName:'aaa'};
      vm.data= [{fieldtype: 'input',key:'companyName'}]; 
  });
  </code></pre>
  
  <p>The ui-router is </p>
  
  <pre><code>  .state('register', {
          //     abstract: true,
          url: "/register",
          templateUrl: "/views/register.html",
          controller: 'RegisterCtrl',
          controlleras: 'vm'
        })
  </code></pre>
  
  <p>I have a verify basic html to show the output of model:</p>
  
  <pre><code>&lt;h2&gt;Model&lt;/h2&gt;
  &lt;pre&gt;{{vm.model }}&lt;/pre&gt;
  </code></pre>
  
  <p>When debugging the code in chrome it passes through the controller code and sets both model and data correctly, but when the page has finished loading  the vm.model is blank.I am not sure what I am doing incorrectly.</p>
  
  <p>Thanks in advance.</p>