Ngx-mask: How I get the value with prefix?

Created on 14 Feb 2020  路  3Comments  路  Source: JsDaddy/ngx-mask

How can I get the value along with the prefix?

For example:
<input prefix="+7 (7" mask="00) 000-00-00">

i get value without +7(7

i need value with prefix. Please help!

All 3 comments

I use a crutch:
control.valueChanges .pipe( debounceTime(500) ) .subscribe((value: string) => value = prefix + value + suffix; this.control.setValue( value, { onlySelf: true, emitEvent: false, emitModelToViewChange: false, emitViewToModelChange: false } ); );

@ABaranchugov @sbeka Hi. Thank you got using ngx-mask. Please try version 11.1.2 . Now you [dropSpecialCharacters]=false not skip prefix

what about suffix? i need the same for it

Was this page helpful?
0 / 5 - 0 ratings