A simple validation mechanism for input fields:
http://plnkr.co/edit/tLUgt2fcQe5gEU82Ezw9?p=preview

I think the "proper" way though is to create a directive and bind to the 
element, google: angular input validation



On Tuesday, May 19, 2015 at 4:03:38 PM UTC-4, [email protected] wrote:
>
> Hi 
>
> I am an angular newbie and any help at all will be greatly appreciated. My 
> requirements are as follows
>
> I have a phone input field with an ng-pattern that only allows 10 digits. 
> However a new requirement has been requested whereby the user should be 
> able to enter in a number that has spaces e.g. 097 654 7654.
> Basically what I need to be able to do then is basically strip out said 
> spaces and update the model and view values and then run the validators to 
> make sure the data entered is numeric and is 10 digits in length.
>
> I hope this make sense and again as I say any help will be greatly 
> appreciated
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to