SHARE
TWEET

Untitled

a guest Oct 20th, 2016 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    function formValidation() {
  2.  
  3.         return {
  4.             restrict: 'C',
  5.             replace: false,
  6.             scope: {
  7.                 city: '=addCardScope'
  8.  
  9.             },
  10.             link: function ($scope, $element, $attrs) {
  11.  
  12.  
  13.                 $scope.$watch('addCardScope.city', function(v) {
  14.                     console.log("Value from City: " + $scope.city);
  15.                     console.log("Value from City V: " + v);
  16.                 });
  17.  
  18.  
  19.             }
  20.         };
  21.     }
  22.  
  23. ===========================================
  24. ================ HTML =====================
  25. ===========================================
  26.  
  27. <form id="ccForm" class="form-validation customer-address-form" name="ccForm" formid="ccForm" action="" method="post">
  28.      <input id="city" type="text" class="validate" ng-model="addCardScope.city" maxlength="30" />
  29.      <div>{{city}}</div>
  30. </form>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top