I finally provided the mask, but here's the problem:
when the field gets focused, i get a TypeError in console:
Uncaught TypeError: Cannot read property 'toString' of undefined.
Is this about empty ng-model, when field is empty of something else?
The data from input is handled by formController, which creates an empty object and adds properties from <form> to it. Because of this TypeError, I can't implement client validation of 'phone' field, cause there's no value at all, when mask is on. But if i fill the input, it transfers to object without any problems.
How can I resolve this problem?
I finally provided the mask, but here's the problem: when the field gets focused, i get a TypeError in console:
Uncaught TypeError: Cannot read property 'toString' of undefined
. Is this about empty ng-model, when field is empty of something else? The data from input is handled by formController, which creates an empty object and adds properties from<form>
to it. Because of this TypeError, I can't implement client validation of 'phone' field, cause there's no value at all, when mask is on. But if i fill the input, it transfers to object without any problems. How can I resolve this problem?Here's my repo again to watch the project: https://github.com/ermolaevalexey/alfamotors-test-angular