Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

ui.mask Model is validated only after change #351

Closed
dimrsilva opened this issue Jan 29, 2015 · 1 comment
Closed

ui.mask Model is validated only after change #351

dimrsilva opened this issue Jan 29, 2015 · 1 comment
Labels

Comments

@dimrsilva
Copy link

I need to set the mask depending on a previous field.
So, I created a scope var to the mask definition, but the field is only validated after first interaction.

Here is an example: http://jsfiddle.net/y3py47ns/

Apparently, the model value needs to be updated for the validation works.
I did a little trick for that on my client code:

  • change model value
  • trigger $scope.$apply()
  • restore model value
  • trigger $scope.$apply()
var original = $scope.modelValue;
$scope.modelValue = '';
$scope.$apply();
$scope.modelValue = doc;
$scope.$apply();
@PowerKiKi PowerKiKi added ui-mask and removed ui-mask labels Jul 1, 2015
@PowerKiKi
Copy link
Contributor

UI.Utils modules was split in individuals repositories. If still valid, please consider re-submitting on its dedicated repository: https://github.com/angular-ui/ui-mask

See the README for details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants