-
Notifications
You must be signed in to change notification settings - Fork 128
Lazy loading
AlexKhymenko edited this page Aug 24, 2017
·
1 revision
When you lazy load a module, you should use the forChild
static method to import the NgxPermissionsModule
.
Since lazy loaded modules use a different injector from the rest of your application, you can configure them separately.
You can also isolate the service by using permissionsIsolate: true
or rolesIsolate: true
. In which case the service is a completely isolated instance.
Otherwise, by default, it will share its data with other instances of the service.
@NgModule({
imports: [
NgxPermissionsModule.forChild()
]
})
export class LazyLoadedModule { }
@NgModule({
imports: [
NgxPermissionsModule.forChild({
permissionsIsolate: true,
rolesIsolate: true})
]
})
export class LazyIsolatedLoadedModule { }
Thank You for using the library and support 🌟 . HAVE A GREAT DAY!