I'm trying to use the mask attribute in a lazy loaded module, RegisterModule. Importing NgxMaskModule.forRoot() in my AppModule does nothing, but if I add it to the RegisterModule, everything works fine.
Example of my routes structure:
const routes: Routes = [
{ path: '', redirectTo: 'para-voce', pathMatch: 'full' },
{
path: '', component: SiteLayoutComponent, children: [
{ path: 'para-voce', loadChildren: '../app/components/for-you/for-you.module#ForYouModule' },
{ path: 'para-sua-empresa', loadChildren: '../app/components/for-company/for-company.module#ForCompanyModule' },
{ path: 'para-seu-estabelecimento', loadChildren: '../app/components/for-store/for-store.module#ForStoreModule' },
{ path: 'fale-conosco', loadChildren: '../app/components/contact-us/contact-us.module#ContactUsModule' }
]
},
{
path: '', component: AuthLayoutComponent, children: [
{ path: 'login', loadChildren: '../app/components/auth/login/login.module#LoginModule' },
{ path: 'nova-conta', loadChildren: '../app/components/auth/register/register.module#RegisterModule' }
]
}
];
Could you provide me some light on this? Thanks a lot.
Please learn angular basics first. Read how modules in the angular works before asking silly questions.
Actually it was a confusion I made with my unit tests that day. Importing NgxMaskModule.forRoot() in the AppModule, then importing NgxMaskModule in the lazy loaded module did fix the problem. But, by the nature of separate testing modules, I had to import NgxMaskModule.forRoot() in the lazy loaded module before seeing the error go away. Anyway, a really silly CONFUSION. Thanks for your high level of "education" and hospitality. The issue can be closed.