Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   //If the first number is not Zero.
  2.             if (accountNumber && accountNumber.substr(0, 1) != 0) {
  3.  
  4.                 accountNumber = '0' + accountNumber;
  5.  
  6.                 //@source: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController
  7.  
  8.                 //Sets the new account number to the view model - Staged.
  9.                 $scope.form_add_payee.accountno.$setViewValue(accountNumber, 'blur');
  10.  
  11.                 // Commit the view model value - committed.
  12.                 $scope.form_add_payee.accountno.$commitViewValue();
  13.  
  14.                 // Render the new value to the input field.
  15.                 $scope.form_add_payee.accountno.$render();
  16.  
  17.                 // Ignore the validity checking of the field on this model change.
  18.                 $scope.form_add_payee.accountno.$setValidity('pattern', true);
  19.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement