title: How to get data from form input
body: <p>Im new to mobile development, especially using Ionic. Please help me out</p>
  
  <p>I have this code for my route</p>
  
  <pre><code>.state('auth', {
  url: '/auth',
  templateUrl: 'templates/login.html',
  controller: 'AuthCtrl'
  </code></pre>
  
  <p>I have this code for my login.html</p>
  
  <pre><code>&lt;ion-view view-title="Login" name="login-view"&gt;
  &lt;ion-content class="padding"&gt;
      &lt;div class="list list-inset"&gt;
          &lt;label class="item item-input"&gt;
              &lt;input type="text" placeholder="Mobile Number" ng-model="mobile_number"&gt;
          &lt;/label&gt;
          &lt;label class="item item-input"&gt;
              &lt;input type="password" placeholder="Password" ng-model="password"&gt;
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;button class="button button-block button-calm" ng-click="login()"&gt;Login&lt;/button&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p></p>
  
  <p>and for my AuthCtrl</p>
  
  <pre><code>.controller('AuthCtrl', function($scope,$auth,$state) {
  
  $scope.login = function() {
      var credentials = {
          mobile_number : $scope.mobile_number,
          password : $scope.password,
      }
      console.log(credentials);
      $auth.login(credentials).then(function(data) {
          // If login is successful, redirect to the users state
          $state.go('tab.dash', {});
      });
  }
  </code></pre>
  
  <p>})</p>
  
  <p>I always get this <strong>Object {mobile_number: undefined, password: undefined}</strong> when calling <em>console.log(credentials)</em>
  I always put values in my forms, but its always undefined. Why?</p>