title: How to pass one or more field value to another field custom directive
body: <p>I have search on Internet, how to pass one field value to another field custom directive. But i did not get success. Here is the code:</p>
  
  <pre><code>module.directive("confirmPassword", function(){
      return {        
          restrict: 'A',
          require: '?ngModel',
          scope: {
            cpassword: '=confirmPassword'
          },
          link: function(scope, element, attrs,ctrl){ 
            if(!ctrl) return;
  
            console.log(scope.cpassword);
            ctrl.$validators.confirmPasswd = function(modelValue, viewValue) {
              var value = modelValue || viewValue;
              console.log(attrs.confirmPassword);
              console.log(value);
                if(angular.isDefined(value)){
                    if(scope.cpassword.test(value)) {
                        scope.confirmStrength = 'valid';
                        ctrl.$setValidity("confirmInvalid",true);
                        return true;
                    } else {
                        scope.confirmStrength = 'invalid';
                        ctrl.$setValidity("confirmInvalid",false);
                        return false;
                    }
                }
                return false;
            }
          }
      };
  });
  </code></pre>
  
  <p>and in i am applying this custom directive to the field like:</p>
  
  <pre><code>&lt;input type="password" confirm-password="registerData.password" ng-model="registerData.confirmPassword"&gt;
  </code></pre>
  
  <p>but i am not getting desire output. something i am missing in this. Please help me somebody. I am using angularJs 1.4 version.</p>
  
  <p>Please find <a href="http://plnkr.co/edit/MXTPqXMUWIQVIdS7sbyF?p=preview" rel="nofollow">Plunker</a></p>