Hello,
I have this issue and I cant't make it work anyway. I've read a lot of things, but nothing seems to work.
I'm using angular 8.1.3 and ngx-mask 8.1.7 with ionic 5.4.2 and cordova 9.0.0.
I have in my app.module.ts
import { NgxMaskModule, IConfig } from 'ngx-mask';
export const options: Partial
imports: [
NgxMaskModule.forRoot(options),
...]
And in my benef.module.ts
import { NgxMaskModule } from 'ngx-mask';
@NgModule({
imports: [
NgxMaskModule.forChild(),
....]
And finally in benef.html
{{benef.phoneNumber | mask: '(000) 000-0000'}}
It's my first angular 2+ project so I'm a little lost. Any idea how can I solve this?
Thanks,
Monica
@marocha Hi!
You export the wrong options. Try to replace line export const options: Partial | (() => Partial) = null; with export const options: Partial<IConfig> | (() => Partial<IConfig>); as we indicated in the mask documentation.
Was it helpful?
Hi @isysenko , I'm in the same situation, and it is not possible to just put what is written in the documentation, because it is not a valid typescript definition : const declarations must be initialized.
Is there a default value that is missing ?
Hi,
@isysenko, many thanks for your answer. I've been away from this for a couple weeks. I solved my problem by adding NgxMaskModule to my benef.module.ts export list. exports: [..., NgxMaskModule ,...]. As I told, I'm new to angular 2+, so I missed this 'small' detail. @chougron, I hope this helps you :)
Thanks for your help,
M贸nica
In my case, I have shared.module that is imported in app.module, so when I was trying to importNgxMaskModulein my app.module module the pipes were not being recognized, my solution was to import the NgxMaskModule module and exporte it from my shared.module
Most helpful comment
Hi,
@isysenko, many thanks for your answer. I've been away from this for a couple weeks. I solved my problem by adding NgxMaskModule to my benef.module.ts export list. exports: [..., NgxMaskModule ,...]. As I told, I'm new to angular 2+, so I missed this 'small' detail. @chougron, I hope this helps you :)
Thanks for your help,
M贸nica