Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //If the first number is not Zero.
- if (accountNumber && accountNumber.substr(0, 1) != 0) {
- accountNumber = '0' + accountNumber;
- //@source: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController
- //Sets the new account number to the view model - Staged.
- $scope.form_add_payee.accountno.$setViewValue(accountNumber, 'blur');
- // Commit the view model value - committed.
- $scope.form_add_payee.accountno.$commitViewValue();
- // Render the new value to the input field.
- $scope.form_add_payee.accountno.$render();
- // Ignore the validity checking of the field on this model change.
- $scope.form_add_payee.accountno.$setValidity('pattern', true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement