I have a component with a input text which I need to put an IP address. I would like to know how to validate to check if its an ipv4 address, and if its possibly to mask it as well. I cannot find any component to do that.
Asked
Active
Viewed 1,265 times
0
-
What do you mean by "masking" the IP address? – Mar 22 '18 at 14:19
-
mask the user input – gog Mar 22 '18 at 14:24
-
you can try https://www.npmjs.com/package/ng2-input-mask – Roman Skydan Mar 22 '18 at 14:24
-
You can use a simple pattern validator like here: https://stackoverflow.com/questions/44176120/pattern-validator-is-invalid-for-ip-address-regex – Roland Rácz Mar 22 '18 at 15:02