Fix post-upgrade errors

This commit is contained in:
eugene-sinitsyn 2020-03-03 15:41:09 +03:00
parent d673c512ec
commit 88020acd3e
6 changed files with 17 additions and 25 deletions

View file

@ -153,9 +153,6 @@ export const NB_CORE_PROVIDERS = [
NbAuthModule, NbAuthModule,
], ],
declarations: [], declarations: [],
providers: [
...NB_CORE_PROVIDERS
]
}) })
export class CoreModule { export class CoreModule {
constructor(@Optional() @SkipSelf() parentModule: CoreModule) { constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
@ -163,7 +160,7 @@ export class CoreModule {
} }
static forRoot(): ModuleWithProviders<CoreModule> { static forRoot(): ModuleWithProviders<CoreModule> {
return <ModuleWithProviders>{ return {
ngModule: CoreModule, ngModule: CoreModule,
providers: [ providers: [
...NB_CORE_PROVIDERS, ...NB_CORE_PROVIDERS,

View file

@ -74,18 +74,10 @@ const PIPES = [
imports: [CommonModule, ...NB_MODULES], imports: [CommonModule, ...NB_MODULES],
exports: [CommonModule, ...PIPES, ...COMPONENTS], exports: [CommonModule, ...PIPES, ...COMPONENTS],
declarations: [...COMPONENTS, ...PIPES], declarations: [...COMPONENTS, ...PIPES],
providers: [
...NbThemeModule.forRoot(
{
name: 'default',
},
[ DEFAULT_THEME, COSMIC_THEME, CORPORATE_THEME, DARK_THEME ],
).providers,
]
}) })
export class ThemeModule { export class ThemeModule {
static forRoot(): ModuleWithProviders<ThemeModule> { static forRoot(): ModuleWithProviders<ThemeModule> {
return <ModuleWithProviders>{ return {
ngModule: ThemeModule, ngModule: ThemeModule,
providers: [ providers: [
...NbThemeModule.forRoot( ...NbThemeModule.forRoot(

View file

@ -37,8 +37,8 @@ import {
NbChatModule.forRoot({ NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY', messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}), }),
CoreModule, CoreModule.forRoot(),
ThemeModule, ThemeModule.forRoot(),
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })

View file

@ -1,4 +1,4 @@
import { Component, OnDestroy } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { NbMediaBreakpoint, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme'; import { NbMediaBreakpoint, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme';
import { takeWhile } from 'rxjs/operators'; import { takeWhile } from 'rxjs/operators';
import { CountryOrderData } from '../../../@core/data/country-order'; import { CountryOrderData } from '../../../@core/data/country-order';
@ -22,7 +22,7 @@ import { CountryOrderData } from '../../../@core/data/country-order';
</nb-card> </nb-card>
`, `,
}) })
export class CountryOrdersComponent implements OnDestroy { export class CountryOrdersComponent implements OnInit, OnDestroy {
private alive = true; private alive = true;
@ -36,6 +36,9 @@ export class CountryOrdersComponent implements OnDestroy {
private breakpointService: NbMediaBreakpointsService, private breakpointService: NbMediaBreakpointsService,
private countryOrderService: CountryOrderData) { private countryOrderService: CountryOrderData) {
this.breakpoints = this.breakpointService.getBreakpointsMap(); this.breakpoints = this.breakpointService.getBreakpointsMap();
}
ngOnInit() {
this.themeService.onMediaQueryChange() this.themeService.onMediaQueryChange()
.pipe(takeWhile(() => this.alive)) .pipe(takeWhile(() => this.alive))
.subscribe(([oldValue, newValue]) => { .subscribe(([oldValue, newValue]) => {

View file

@ -4,14 +4,14 @@ import { Component } from '@angular/core';
selector: 'ngx-gmaps', selector: 'ngx-gmaps',
styleUrls: ['./gmaps.component.scss'], styleUrls: ['./gmaps.component.scss'],
template: ` template: `
<nb-card> <!-- <nb-card>
<nb-card-header>Google Maps</nb-card-header> <nb-card-header>Google Maps</nb-card-header>
<nb-card-body> <nb-card-body>
<!-- <agm-map [latitude]="lat" [longitude]="lng"> <agm-map [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker> <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map> --> </agm-map>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card> -->
`, `,
}) })
export class GmapsComponent { export class GmapsComponent {

View file

@ -1,10 +1,10 @@
<nb-card> <!-- <nb-card>
<nb-card-header> <nb-card-header>
Smart Table Smart Table
</nb-card-header> </nb-card-header>
<nb-card-body> <nb-card-body>
<!-- <ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)"> <ng2-smart-table [settings]="settings" [source]="source" (deleteConfirm)="onDeleteConfirm($event)">
</ng2-smart-table> --> </ng2-smart-table>
</nb-card-body> </nb-card-body>
</nb-card> </nb-card> -->