mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
refactor(@core): refactor data services for better integration (#1997)
With this change all components, which used data services before, now use abstract classes of service interfaces, mock services extend interface services, CoreModule contains code to inject a needed implementation of some service.
This commit is contained in:
parent
f17aa32c6d
commit
cac36f0717
67 changed files with 389 additions and 201 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
import { Electricity, ElectricityChart, ElectricityService } from '../../../@core/data/electricity.service';
|
||||
import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
|
||||
import { takeWhile } from 'rxjs/operators';
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ export class ElectricityComponent implements OnDestroy {
|
|||
currentTheme: string;
|
||||
themeSubscription: any;
|
||||
|
||||
constructor(private electricityService: ElectricityService,
|
||||
constructor(private electricityService: ElectricityData,
|
||||
private themeService: NbThemeService) {
|
||||
this.themeService.getJsTheme()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
|
|
@ -36,7 +36,7 @@ export class ElectricityComponent implements OnDestroy {
|
|||
this.electricityService.getChartData(),
|
||||
)
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(([listData, chartData]) => {
|
||||
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]] ) => {
|
||||
this.listData = listData;
|
||||
this.chartData = chartData;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue