incorrect work in prod mode
Hello. Module don't works in production mode, but in developer mode all right. How I'm using it on input: <input class="form-control" type="text" title="Телефон" formControlName="phone" [dropSpecialCharacters]="false" [showMaskTyped]="true" mask="+7(000)0000000">
Config in app.module:
NgxMaskModule.forRoot({
patterns : {
'7': {
pattern: new RegExp('\[7\]')
},
'0': {
pattern: new RegExp('\[0-9\]')
},
'A': {
pattern: new RegExp('\[0-9A-Za-z\]')
}
}
}),
Angular 6, ngx-mask 6.5.18
Thx for your answers.
@beckon111 We will check
I tried to do config in const, but it Isn't affect on it. If turn aot off build works fine. (ng build --prod --build-optimizer=false --aot=false)
Angular compiler doesn't support regexes and strips them away. One solution is to accept strings in config and convert them to regex at runtime.
@beckon111 Why do you need to declare a custom pattern ? As i see you trued to set standard values for '0' and 'A' and +7 is a prefix
