ngMask icon indicating copy to clipboard operation
ngMask copied to clipboard

constant number in mask

Open perython opened this issue 9 years ago • 9 comments

Hey @candreoliveira, thanks for the plugin!

I want to have this kind of mask for phone number: +1 (999) 999-99-99. Here number 1 should be constant 1, just like plus sign.

Is it possible to set constant number in the mask? I haven't found an example of it.

perython avatar Apr 27 '15 14:04 perython

Not yet. But I'm rewriting the mask to improve quality and I'll cover it. Thanks!

candreoliveira avatar Apr 30 '15 04:04 candreoliveira

+1 i need it

LennyLip avatar May 03 '15 05:05 LennyLip

+1 really need it for phone input

drakmail avatar May 03 '15 13:05 drakmail

+1 need it for country code for phone number ( for example +7 (999) 999-99-99 )

also it would be nice if i can set regexp for some part of mask, for example i need complex check of first part of number - only 910 and 920 ( +7 (910) XXX-XX-XX or +7 (920) XXX-XX-XX )

resetko avatar May 13 '15 08:05 resetko

As workaround I'm used bootstraps input group addon like this:

<div class="input-group">
  <span class="input-group-addon" id="basic-addon1">+7</span>
  <input type="text" class="form-control" placeholder="(___) ___ __ __"  ng-model="maskModel" mask="(999) 999 99 99">
</div>

drakmail avatar May 13 '15 08:05 drakmail

i think, we need not only constant, it can be list like a: +(7,) +(7,8) +(2,7,8)

etc...

may be result of @candreoliveira rewriting proccess is replaced current mask syntax with "all known" regex syntax?

LennyLip avatar May 14 '15 13:05 LennyLip

@candreoliveira hi, is there any progress on this? Maybe someone else should implement this?

resetko avatar Dec 02 '15 12:12 resetko

Any progress on this? @candreoliveira

drugoi avatar May 11 '16 12:05 drugoi

any progress? @candreoliveira

drakmail avatar Jun 10 '16 19:06 drakmail