Mask not properly formatting ng-model
Owizardo opened this issue · 1 comments
Owizardo commented
Hi there,
For some reason when I try to put:
<input ng-model="test" ui-mask-placeholder ui-mask-placeholder-char="space" ui-mask="9999-99-99 99:99" />
The the input field masks correctly as expected but once I enter a correct date for example 2016-12-06 00:00, the ng-model shows up as 20161200000 instead of 2016-12-06 00:00. Has anyone run into this issue before? Kinda of a deal breaker for me if it cant keep the correct format.
RafaelTaranto commented
Hello @Owizardo,
There is a model-view-value option to make the mask a part of the model.
Using the following code should work
<input ng-model="test" ui-mask-placeholder ui-mask-placeholder-char="space" ui-mask="9999-99-99 99:99" model-view-value="true" />