Importing NgxPermissionsModule.forRoot() in app.module is done!
Importing NgxPermissionsModule.forChild(), in child components is done!
Whether it's LazyLoading or not, it doesn't work for the components!
BUT
when I add *ngxPermissionsOnly="['ADMIN']" to app.component.html it works! So It's facing the problem just for child components!
I tried many different ways and found a solution! Including the child components in declarations array in app.module!
But I don't like this solution! And I think it is in contrast with the LazyLoading concept!
Also using sharedModule didn't solve the problem!
I work with angular 13.x and ngx-permission 13.x - it works by importingforchild() in the lazy loaded module. Can you share the minimal reproducible code in stack-blitz?
When a child component with this html code:
is being loaded, this error happens:
Importing NgxPermissionsModule.forRoot() in app.module is done! Importing NgxPermissionsModule.forChild(), in child components is done! Whether it's LazyLoading or not, it doesn't work for the components! BUT when I add *ngxPermissionsOnly="['ADMIN']" to app.component.html it works! So It's facing the problem just for child components! I tried many different ways and found a solution! Including the child components in declarations array in app.module! But I don't like this solution! And I think it is in contrast with the LazyLoading concept! Also using sharedModule didn't solve the problem!
Environment
Angular version: 14.2.X ngx-permissions version: 14.0.0
Browser: