mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
feat: update to Angular 6 (#1684)
This commit is contained in:
parent
fa3cdf731b
commit
06d2197583
18 changed files with 5448 additions and 4039 deletions
|
|
@ -2,7 +2,7 @@ import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core
|
|||
import { CommonModule } from '@angular/common';
|
||||
import { NbAuthModule, NbDummyAuthProvider } from '@nebular/auth';
|
||||
import { NbSecurityModule, NbRoleProvider } from '@nebular/security';
|
||||
import { of as observableOf } from 'rxjs/observable/of';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { throwIfAlreadyLoaded } from './module-import-guard';
|
||||
import { DataModule } from './data/data.module';
|
||||
|
|
@ -26,7 +26,14 @@ const socialLinks = [
|
|||
},
|
||||
];
|
||||
|
||||
const NB_CORE_PROVIDERS = [
|
||||
export class NbSimpleRoleProvider extends NbRoleProvider {
|
||||
getRole() {
|
||||
// here you could provide any role based on any auth flow
|
||||
return observableOf('guest');
|
||||
}
|
||||
}
|
||||
|
||||
export const NB_CORE_PROVIDERS = [
|
||||
...DataModule.forRoot().providers,
|
||||
...NbAuthModule.forRoot({
|
||||
providers: {
|
||||
|
|
@ -63,12 +70,7 @@ const NB_CORE_PROVIDERS = [
|
|||
},
|
||||
}).providers,
|
||||
{
|
||||
provide: NbRoleProvider,
|
||||
useValue: {
|
||||
getRole: () => {
|
||||
return observableOf('guest'); // here you could provide any role based on any auth flow
|
||||
},
|
||||
},
|
||||
provide: NbRoleProvider, useClass: NbSimpleRoleProvider,
|
||||
},
|
||||
AnalyticsService,
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue