feat: update to Angular 6 (#1684)

This commit is contained in:
Dmitry Nehaychik 2018-05-10 23:48:39 +03:00 committed by GitHub
parent fa3cdf731b
commit 06d2197583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 5448 additions and 4039 deletions

View file

@ -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,
];