title: Cannot get form data with ng-model
body: <p>So I have two forms inside the same controller. </p>
  
  <pre><code>&lt;form name="myForm" id="myForm" class="form-horizontal" ng-submit="saveMyForm(myForm)" &gt;
    &lt;input type="text" id="name" ng-model="name"  /&gt;    
    //...etc
  &lt;/form&gt;
  </code></pre>
  
  <p>and another form</p>
  
  <pre><code>&lt;form name="passForm" id="passForm" ng-submit="savePassForm(passForm)" &gt;
    &lt;input type="password" id="oldpassword" name="oldpassword" ng-model="oldpassword" &gt;    
    &lt;input type="password" id="pw1" name="pw1" ng-model="pw1" &gt;    
    &lt;input type="password" id="pw2" name="pw2" ng-model="pw2"  pw-check="pw1" &gt;    
  &lt;/form&gt;
  
  &lt;div class="msg-block" ng-show="passForm.$error"&gt;
        &lt;span class="msg-error loginError" ng-show="passForm.pw2.$error.pwmatch"&gt;
          Passwords don't match.
        &lt;/span&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>To check if passwords match I have this directive</p>
  
  <pre><code>  app.directive('pwCheck', [function () {
      return {
        require: 'ngModel',
        link: function (scope, elem, attrs, ctrl) {
          var firstPassword = '#' + attrs.pwCheck;
          elem.add(firstPassword).on('keyup', function () {
            scope.$apply(function () {
              var v = elem.val()===$(firstPassword).val();
              ctrl.$setValidity('pwmatch', v);
            });
          });
        }
      }
    }]); 
  </code></pre>
  
  <p>So my first form works fine.</p>
  
  <p>In my second form, the one for passwords, I cannot grab the passwords from the fields to send them to the server. I do</p>
  
  <pre><code> var passData = {                    
       "oldpassword" : $scope.oldpassword,
       "newpassword" : $scope.pw2                           
   }   
  
    $scope.changepassword = function(form){                          
  
       if(form.$valid) {
          var promisePass  = passwordFactory.changePass(passData);
          promisePass.success(function (data, status) {
           //handle
  </code></pre>
  
  <p>When I check my console, there are no data, <code>passData</code> is empty. </p>
  
  <p>What am I missing here? Is it the fact that there are two forms inside the same controller? Does the directive messes things up? </p>
  
  <p>Please help me fix this.</p>
  
  <p>Thanks</p>