mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-09-21 21:40:49 +02: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
|
@ -1,80 +0,0 @@
|
|||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"project": {
|
||||
"name": "ngx-admin-demo"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"root": "src",
|
||||
"outDir": "dist",
|
||||
"assets": [
|
||||
"assets",
|
||||
"favicon.ico",
|
||||
"favicon.png",
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "../node_modules/leaflet/dist/images",
|
||||
"output": "./assets/img/markers"
|
||||
}
|
||||
],
|
||||
"index": "index.html",
|
||||
"main": "main.ts",
|
||||
"polyfills": "polyfills.ts",
|
||||
"test": "test.ts",
|
||||
"tsconfig": "tsconfig.app.json",
|
||||
"testTsconfig": "tsconfig.spec.json",
|
||||
"styles": [
|
||||
"../node_modules/bootstrap/dist/css/bootstrap.css",
|
||||
"../node_modules/typeface-exo/index.css",
|
||||
"../node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
|
||||
"../node_modules/ionicons/scss/ionicons.scss",
|
||||
"../node_modules/font-awesome/scss/font-awesome.scss",
|
||||
"../node_modules/socicon/css/socicon.css",
|
||||
"../node_modules/nebular-icons/scss/nebular-icons.scss",
|
||||
"../node_modules/pace-js/templates/pace-theme-flash.tmpl.css",
|
||||
"./app/@theme/styles/styles.scss"
|
||||
],
|
||||
"scripts": [
|
||||
"../node_modules/pace-js/pace.min.js",
|
||||
"../node_modules/tinymce/tinymce.min.js",
|
||||
"../node_modules/tinymce/themes/modern/theme.min.js",
|
||||
"../node_modules/tinymce/plugins/link/plugin.min.js",
|
||||
"../node_modules/tinymce/plugins/paste/plugin.min.js",
|
||||
"../node_modules/tinymce/plugins/table/plugin.min.js",
|
||||
"../node_modules/echarts/dist/echarts.min.js",
|
||||
"../node_modules/echarts/dist/extension/bmap.min.js",
|
||||
"../node_modules/chart.js/dist/Chart.min.js"
|
||||
],
|
||||
"environmentSource": "environments/environment.ts",
|
||||
"environments": {
|
||||
"dev": "environments/environment.ts",
|
||||
"prod": "environments/environment.prod.ts"
|
||||
}
|
||||
}
|
||||
],
|
||||
"e2e": {
|
||||
"protractor": {
|
||||
"config": "./protractor.conf.js"
|
||||
}
|
||||
},
|
||||
"lint": [
|
||||
{
|
||||
"project": "src/tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"project": "src/tsconfig.spec.json"
|
||||
},
|
||||
{
|
||||
"project": "e2e/tsconfig.e2e.json"
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"karma": {
|
||||
"config": "./karma.conf.js"
|
||||
}
|
||||
},
|
||||
"defaults": {
|
||||
"styleExt": "scss",
|
||||
"component": {}
|
||||
}
|
||||
}
|
174
angular.json
Normal file
174
angular.json
Normal file
|
@ -0,0 +1,174 @@
|
|||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"ngx-admin-demo": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico",
|
||||
"src/favicon.png",
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/leaflet/dist/images",
|
||||
"output": "/assets/img/markers"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"node_modules/bootstrap/dist/css/bootstrap.css",
|
||||
"node_modules/typeface-exo/index.css",
|
||||
"node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
|
||||
"node_modules/ionicons/scss/ionicons.scss",
|
||||
"node_modules/font-awesome/scss/font-awesome.scss",
|
||||
"node_modules/socicon/css/socicon.css",
|
||||
"node_modules/nebular-icons/scss/nebular-icons.scss",
|
||||
"node_modules/pace-js/templates/pace-theme-flash.tmpl.css",
|
||||
"src/app/@theme/styles/styles.scss"
|
||||
],
|
||||
"scripts": [
|
||||
"node_modules/pace-js/pace.min.js",
|
||||
"node_modules/tinymce/tinymce.min.js",
|
||||
"node_modules/tinymce/themes/modern/theme.min.js",
|
||||
"node_modules/tinymce/plugins/link/plugin.min.js",
|
||||
"node_modules/tinymce/plugins/paste/plugin.min.js",
|
||||
"node_modules/tinymce/plugins/table/plugin.min.js",
|
||||
"node_modules/echarts/dist/echarts.min.js",
|
||||
"node_modules/echarts/dist/extension/bmap.min.js",
|
||||
"node_modules/chart.js/dist/Chart.min.js"
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "ngx-admin-demo:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "ngx-admin-demo:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "ngx-admin-demo:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"karmaConfig": "./karma.conf.js",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"scripts": [
|
||||
"node_modules/pace-js/pace.min.js",
|
||||
"node_modules/tinymce/tinymce.min.js",
|
||||
"node_modules/tinymce/themes/modern/theme.min.js",
|
||||
"node_modules/tinymce/plugins/link/plugin.min.js",
|
||||
"node_modules/tinymce/plugins/paste/plugin.min.js",
|
||||
"node_modules/tinymce/plugins/table/plugin.min.js",
|
||||
"node_modules/echarts/dist/echarts.min.js",
|
||||
"node_modules/echarts/dist/extension/bmap.min.js",
|
||||
"node_modules/chart.js/dist/Chart.min.js"
|
||||
],
|
||||
"styles": [
|
||||
"node_modules/bootstrap/dist/css/bootstrap.css",
|
||||
"node_modules/typeface-exo/index.css",
|
||||
"node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
|
||||
"node_modules/ionicons/scss/ionicons.scss",
|
||||
"node_modules/font-awesome/scss/font-awesome.scss",
|
||||
"node_modules/socicon/css/socicon.css",
|
||||
"node_modules/nebular-icons/scss/nebular-icons.scss",
|
||||
"node_modules/pace-js/templates/pace-theme-flash.tmpl.css",
|
||||
"src/app/@theme/styles/styles.scss"
|
||||
],
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico",
|
||||
"src/favicon.png",
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/leaflet/dist/images",
|
||||
"output": "/assets/img/markers"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"src/tsconfig.app.json",
|
||||
"src/tsconfig.spec.json"
|
||||
],
|
||||
"typeCheck": true,
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ngx-admin-demo-e2e": {
|
||||
"root": "",
|
||||
"sourceRoot": "",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "./protractor.conf.js",
|
||||
"devServerTarget": "ngx-admin-demo:serve"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"e2e/tsconfig.e2e.json"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "ngx-admin-demo",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"styleext": "scss"
|
||||
},
|
||||
"@schematics/angular:directive": {}
|
||||
}
|
||||
}
|
|
@ -4,19 +4,19 @@
|
|||
module.exports = function (config) {
|
||||
const configuration = {
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular/cli'],
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular/cli/plugins/karma')
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
angularCli: {
|
||||
|
|
9090
package-lock.json
generated
9090
package-lock.json
generated
File diff suppressed because it is too large
Load diff
42
package.json
42
package.json
|
@ -15,10 +15,10 @@
|
|||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"build:prod": "npm run build -- --prod --aot",
|
||||
"test": "ng test -sr",
|
||||
"test:coverage": "rimraf coverage && npm run test -- -cc",
|
||||
"lint": "ng lint --type-check",
|
||||
"lint:fix": "ng lint --fix",
|
||||
"test": "ng test",
|
||||
"test:coverage": "rimraf coverage && npm run test -- --code-coverage",
|
||||
"lint": "ng lint",
|
||||
"lint:fix": "ng lint ngx-admin-demo --fix",
|
||||
"lint:styles": "stylelint ./src/**/*.scss",
|
||||
"lint:ci": "npm run lint && npm run lint:styles",
|
||||
"pree2e": "webdriver-manager update --standalone false --gecko false",
|
||||
|
@ -30,15 +30,15 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@agm/core": "1.0.0-beta.2",
|
||||
"@angular/animations": "~5.2.6",
|
||||
"@angular/common": "~5.2.6",
|
||||
"@angular/compiler": "~5.2.6",
|
||||
"@angular/core": "~5.2.6",
|
||||
"@angular/forms": "~5.2.6",
|
||||
"@angular/http": "~5.2.6",
|
||||
"@angular/platform-browser": "~5.2.6",
|
||||
"@angular/platform-browser-dynamic": "~5.2.6",
|
||||
"@angular/router": "~5.2.6",
|
||||
"@angular/animations": "6.0.0",
|
||||
"@angular/common": "6.0.0",
|
||||
"@angular/compiler": "6.0.0",
|
||||
"@angular/core": "6.0.0",
|
||||
"@angular/forms": "6.0.0",
|
||||
"@angular/http": "6.0.0",
|
||||
"@angular/platform-browser": "6.0.0",
|
||||
"@angular/platform-browser-dynamic": "6.0.0",
|
||||
"@angular/router": "6.0.0",
|
||||
"@asymmetrik/ngx-leaflet": "3.0.1",
|
||||
"@nebular/auth": "^2.0.0-rc.7",
|
||||
"@nebular/security": "^2.0.0-rc.7",
|
||||
|
@ -65,20 +65,21 @@
|
|||
"normalize.css": "6.0.0",
|
||||
"pace-js": "1.0.2",
|
||||
"roboto-fontface": "0.8.0",
|
||||
"rxjs": "5.5.5",
|
||||
"rxjs": "^6.1.0",
|
||||
"rxjs-compat": "^6.1.0",
|
||||
"socicon": "3.0.5",
|
||||
"tinymce": "4.5.7",
|
||||
"typeface-exo": "0.0.22",
|
||||
"web-animations-js": "2.2.5",
|
||||
"zone.js": "0.8.18"
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "1.7.1",
|
||||
"@angular/compiler-cli": "~5.2.6",
|
||||
"@angular/language-service": "~5.2.6",
|
||||
"@angular/cli": "6.0.0",
|
||||
"@angular/compiler-cli": "6.0.0",
|
||||
"@angular/language-service": "6.0.0",
|
||||
"@compodoc/compodoc": "1.0.1",
|
||||
"@types/googlemaps": "3.30.4",
|
||||
"@types/d3-color": "1.0.5",
|
||||
"@types/googlemaps": "3.30.4",
|
||||
"@types/jasmine": "2.5.54",
|
||||
"@types/jasminewd2": "2.0.3",
|
||||
"@types/leaflet": "1.2.3",
|
||||
|
@ -101,6 +102,7 @@
|
|||
"ts-node": "3.2.2",
|
||||
"tslint": "5.7.0",
|
||||
"tslint-language-service": "0.9.6",
|
||||
"typescript": "2.5.3"
|
||||
"typescript": "2.7.2",
|
||||
"@angular-devkit/build-angular": "~0.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
export class Track {
|
||||
name: string;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
import { of as observableOf, Observable , BehaviorSubject } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
@Injectable()
|
||||
export class StateService {
|
||||
|
@ -48,7 +47,7 @@ export class StateService {
|
|||
}
|
||||
|
||||
getLayoutStates(): Observable<any[]> {
|
||||
return Observable.of(this.layouts);
|
||||
return observableOf(this.layouts);
|
||||
}
|
||||
|
||||
onLayoutState(): Observable<any> {
|
||||
|
@ -60,7 +59,7 @@ export class StateService {
|
|||
}
|
||||
|
||||
getSidebarStates(): Observable<any[]> {
|
||||
return Observable.of(this.sidebars);
|
||||
return observableOf(this.sidebars);
|
||||
}
|
||||
|
||||
onSidebarState(): Observable<any> {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
import { of as observableOf, Observable } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/of';
|
||||
|
||||
|
||||
let counter = 0;
|
||||
|
||||
|
@ -23,15 +24,15 @@ export class UserService {
|
|||
}
|
||||
|
||||
getUsers(): Observable<any> {
|
||||
return Observable.of(this.users);
|
||||
return observableOf(this.users);
|
||||
}
|
||||
|
||||
getUserArray(): Observable<any[]> {
|
||||
return Observable.of(this.userArray);
|
||||
return observableOf(this.userArray);
|
||||
}
|
||||
|
||||
getUser(): Observable<any> {
|
||||
counter = (counter + 1) % this.userArray.length;
|
||||
return Observable.of(this.userArray[counter]);
|
||||
return observableOf(this.userArray[counter]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import { filter } from 'rxjs/operator/filter';
|
||||
import { filter } from 'rxjs/operators';
|
||||
|
||||
declare const ga: any;
|
||||
|
||||
|
@ -16,7 +15,9 @@ export class AnalyticsService {
|
|||
|
||||
trackPageViews() {
|
||||
if (this.enabled) {
|
||||
filter.call(this.router.events, (event) => event instanceof NavigationEnd)
|
||||
this.router.events.pipe(
|
||||
filter((event) => event instanceof NavigationEnd),
|
||||
)
|
||||
.subscribe(() => {
|
||||
ga('send', {hitType: 'pageview', page: this.location.path()});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { delay, withLatestFrom } from 'rxjs/operators';
|
||||
import { Subscription } from 'rxjs';
|
||||
import {
|
||||
NbMediaBreakpoint,
|
||||
NbMediaBreakpointsService,
|
||||
|
@ -10,10 +12,6 @@ import {
|
|||
|
||||
import { StateService } from '../../../@core/data/state.service';
|
||||
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import 'rxjs/add/operator/withLatestFrom';
|
||||
import 'rxjs/add/operator/delay';
|
||||
|
||||
// TODO: move layouts into the framework
|
||||
@Component({
|
||||
selector: 'ngx-sample-layout',
|
||||
|
@ -25,9 +23,9 @@ import 'rxjs/add/operator/delay';
|
|||
</nb-layout-header>
|
||||
|
||||
<nb-sidebar class="menu-sidebar"
|
||||
tag="menu-sidebar"
|
||||
responsive
|
||||
[right]="sidebar.id === 'right'">
|
||||
tag="menu-sidebar"
|
||||
responsive
|
||||
[right]="sidebar.id === 'right'">
|
||||
<nb-sidebar-header>
|
||||
<a href="#" class="btn btn-hero-success main-btn">
|
||||
<i class="ion ion-social-github"></i> <span>Support Us</span>
|
||||
|
@ -53,16 +51,16 @@ import 'rxjs/add/operator/delay';
|
|||
</nb-layout-footer>
|
||||
|
||||
<nb-sidebar class="settings-sidebar"
|
||||
tag="settings-sidebar"
|
||||
state="collapsed"
|
||||
fixed
|
||||
[right]="sidebar.id !== 'right'">
|
||||
tag="settings-sidebar"
|
||||
state="collapsed"
|
||||
fixed
|
||||
[right]="sidebar.id !== 'right'">
|
||||
<ngx-theme-settings></ngx-theme-settings>
|
||||
</nb-sidebar>
|
||||
</nb-layout>
|
||||
`,
|
||||
})
|
||||
export class SampleLayoutComponent implements OnDestroy {
|
||||
export class SampleLayoutComponent implements OnDestroy {
|
||||
|
||||
subMenu: NbMenuItem[] = [
|
||||
{
|
||||
|
@ -127,8 +125,10 @@ export class SampleLayoutComponent implements OnDestroy {
|
|||
|
||||
const isBp = this.bpService.getByName('is');
|
||||
this.menuClick$ = this.menuService.onItemSelect()
|
||||
.withLatestFrom(this.themeService.onMediaQueryChange())
|
||||
.delay(20)
|
||||
.pipe(
|
||||
withLatestFrom(this.themeService.onMediaQueryChange()),
|
||||
delay(20),
|
||||
)
|
||||
.subscribe(([item, [bpFrom, bpTo]]: [any, [NbMediaBreakpoint, NbMediaBreakpoint]]) => {
|
||||
|
||||
if (bpTo.width <= isBp.width) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { delay } from 'rxjs/operators';
|
||||
import { AfterViewInit, Component, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
|
@ -41,7 +42,7 @@ export class ElectricityChartComponent implements AfterViewInit, OnDestroy {
|
|||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.themeSubscription = this.theme.getJsTheme().delay(1).subscribe(config => {
|
||||
this.themeSubscription = this.theme.getJsTheme().pipe(delay(1)).subscribe(config => {
|
||||
const eTheme: any = config.variables.electricity;
|
||||
|
||||
this.option = {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { delay } from 'rxjs/operators';
|
||||
import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
|
@ -41,7 +42,7 @@ export class SolarComponent implements AfterViewInit, OnDestroy {
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.themeSubscription = this.theme.getJsTheme().delay(1).subscribe(config => {
|
||||
this.themeSubscription = this.theme.getJsTheme().pipe(delay(1)).subscribe(config => {
|
||||
|
||||
const solarTheme: any = config.variables.solar;
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { delay } from 'rxjs/operators';
|
||||
import { AfterViewInit, Component, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
|
@ -23,7 +24,7 @@ export class TrafficChartComponent implements AfterViewInit, OnDestroy {
|
|||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.themeSubscription = this.theme.getJsTheme().delay(1).subscribe(config => {
|
||||
this.themeSubscription = this.theme.getJsTheme().pipe(delay(1)).subscribe(config => {
|
||||
|
||||
const trafficTheme: any = config.variables.traffic;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { combineLatest } from 'rxjs/observable/combineLatest';
|
||||
import { takeWhile } from 'rxjs/operators/takeWhile';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { takeWhile } from 'rxjs/operators';
|
||||
import { NgxEchartsService } from 'ngx-echarts';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
|
|
|
@ -68,8 +68,6 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
|
|||
* Date, currency, decimal and percent pipes.
|
||||
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
||||
*/
|
||||
import 'intl'; // Run `npm install --save intl`.
|
||||
import 'intl/locale-data/jsonp/en';
|
||||
import 'core-js/es7/array';
|
||||
import 'core-js/es7/object';
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
]
|
||||
},
|
||||
"files": [
|
||||
"test.ts"
|
||||
"test.ts",
|
||||
"polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
true
|
||||
],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue