Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

What is the use of angular ui-mask?

Writer Matthew Martinez

This is the only documentation that i could find. And it does not make much sense to me. There is no official demo available as far as i can see.

ui-mask-placeholder and ui-mask-placeholder-char do not seem to work.

When the user types some value in the masked field, the mask vanishes and the user can type any value he wants. So basically I am just left using a placeholder. Then what is the point of the ui-mask? What am I missing?

1 Answer

ui-mask defines a input pattern and forces the user to put a value that fit with it.

For instance, with a mask set to (999) 999-9999, the user will ony be able to put some values as (123) 456-7890.

The mask definition considers these patterns:

A Any letter.

9 Any number.

* Any letter or number.

? Make any part of the mask optional.

So, if you define a mask as AAAAA-AAAAA, user can only write some hello-world or qwert-yuiop as value (Only letters).

The default placeholder char is the char that is used as "fill" in the input when it's focused and the value is empty:

If you choose a mask AAAAA-AAAAA and a default placeholder char _ (default), you will have _____-_____ when you focus input field.

If you choose a default placeholder char X, you will have XXXXX-XXXXX

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy