title: Cannot set property 'login' of undefined after add a new page?
body: <p>I'm running the app using ripple in visual studio. The JS developer tools shows the following error after adding a new page. Which line caused the error?</p>
  
  <pre><code>ionic.bundle.js:25642 TypeError: Cannot set property 'login' of undefined
      at new &lt;anonymous&gt; (http://localhost:4400/js/controllers.js:10:18)
      at invoke (http://localhost:4400/lib/ionic/js/ionic.bundle.js:17762:17)
      at Object.instantiate (http://localhost:4400/lib/ionic/js/ionic.bundle.js:17770:27)
      at http://localhost:4400/lib/ionic/js/ionic.bundle.js:22326:28
      at Object.self.appendViewElement (http://localhost:4400/lib/ionic/js/ionic.bundle.js:56883:24)
      at Object.render (http://localhost:4400/lib/ionic/js/ionic.bundle.js:54995:41)
      at Object.init (http://localhost:4400/lib/ionic/js/ionic.bundle.js:54915:20)
      at Object.self.render (http://localhost:4400/lib/ionic/js/ionic.bundle.js:56743:14)
      at Object.self.register (http://localhost:4400/lib/ionic/js/ionic.bundle.js:56701:10)
      at updateView (http://localhost:4400/lib/ionic/js/ionic.bundle.js:62357:23) &lt;ion-nav-view name="side-menu21" class="view-container" nav-view-transition="android"&gt;
  </code></pre>
  
  <p>I did the following steps to add the page.</p>
  
  <p><strong>controllers.js</strong></p>
  
  <pre><code>.controller('LoginCtrl', ['client', function (client, $scope, $state) {
      $scope.login = function() {
          client.login("facebook").then(function succes(data){
              console.log('logged in succesfully..')
              $state.go('menu.events');
          }, function(error){
              console.log('login failed.');
              //login failed.
          });
      }
  }])
  </code></pre>
  
  <p><strong>routers.js</strong></p>
  
  <pre><code>  .state('menu.login', {
      url: '/login',
      views: {
          'side-menu21': {
              templateUrl: 'templates/login.html',
              controller: 'LoginCtrl'
          }
      }
    })
  </code></pre>
  
  <p><strong>service.js</strong></p>
  
  <pre><code>.factory('client', [function () {
      var client = new WindowsAzure.MobileServiceClient("https://mysite.azurewebsites.net/");
      return client;
  }])
  ;
  </code></pre>
  
  <p>The file <strong>login.html</strong> is added.</p>
  
  <pre><code>&lt;ion-view view-title="Sign in"&gt;
      &lt;ion-content&gt;
          &lt;a class="item button button-block button-assertive" ng-click="login()"&gt;
              Sign In With Facebook
          &lt;/a&gt;
      &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p>Also added meta <code>&lt;meta http-equiv="Content-Security-Policy" content="default-src data: gap: *; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'"&gt;</code> and the reference in index.html: <code>&lt;script src="js/azure-mobile-apps-client.min.js"&gt;&lt;/script&gt;</code>.</p>