mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 07:30:12 +01:00
update forkJoin parameters since it's new version now receives an array of observables
This commit is contained in:
parent
017ba9188f
commit
3d1f870c91
4 changed files with 17 additions and 18 deletions
|
|
@ -17,10 +17,10 @@ export class ContactsComponent implements OnDestroy {
|
|||
recent: any[];
|
||||
|
||||
constructor(private userService: UserData) {
|
||||
forkJoin(
|
||||
forkJoin([
|
||||
this.userService.getContacts(),
|
||||
this.userService.getRecentUsers(),
|
||||
)
|
||||
])
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(([contacts, recent]: [Contacts[], RecentUsers[]]) => {
|
||||
this.contacts = contacts;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
|
||||
import { takeWhile } from 'rxjs/operators';
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
|
@ -24,19 +23,19 @@ export class ElectricityComponent implements OnDestroy {
|
|||
themeSubscription: any;
|
||||
|
||||
constructor(private electricityService: ElectricityData,
|
||||
private themeService: NbThemeService) {
|
||||
private themeService: NbThemeService) {
|
||||
this.themeService.getJsTheme()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(theme => {
|
||||
this.currentTheme = theme.name;
|
||||
});
|
||||
});
|
||||
|
||||
forkJoin(
|
||||
forkJoin([
|
||||
this.electricityService.getListData(),
|
||||
this.electricityService.getChartData(),
|
||||
)
|
||||
this.electricityService.getChartData()
|
||||
])
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]] ) => {
|
||||
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]]) => {
|
||||
this.listData = listData;
|
||||
this.chartData = chartData;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,17 +27,17 @@ export class TemperatureComponent implements OnDestroy {
|
|||
themeSubscription: any;
|
||||
|
||||
constructor(private themeService: NbThemeService,
|
||||
private temperatureHumidityService: TemperatureHumidityData) {
|
||||
private temperatureHumidityService: TemperatureHumidityData) {
|
||||
this.themeService.getJsTheme()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(config => {
|
||||
this.theme = config.variables.temperature;
|
||||
});
|
||||
this.theme = config.variables.temperature;
|
||||
});
|
||||
|
||||
forkJoin(
|
||||
forkJoin([
|
||||
this.temperatureHumidityService.getTemperatureData(),
|
||||
this.temperatureHumidityService.getHumidityData(),
|
||||
)
|
||||
])
|
||||
.subscribe(([temperatureData, humidityData]: [Temperature, Temperature]) => {
|
||||
this.temperatureData = temperatureData;
|
||||
this.temperature = this.temperatureData.value;
|
||||
|
|
|
|||
|
|
@ -14,22 +14,22 @@ export class ECommerceVisitorsAnalyticsComponent implements OnDestroy {
|
|||
private alive = true;
|
||||
|
||||
pieChartValue: number;
|
||||
chartLegend: {iconColor: string; title: string}[];
|
||||
chartLegend: { iconColor: string; title: string }[];
|
||||
visitorsAnalyticsData: { innerLine: number[]; outerLine: OutlineData[]; };
|
||||
|
||||
constructor(private themeService: NbThemeService,
|
||||
private visitorsAnalyticsChartService: VisitorsAnalyticsData) {
|
||||
private visitorsAnalyticsChartService: VisitorsAnalyticsData) {
|
||||
this.themeService.getJsTheme()
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(theme => {
|
||||
this.setLegendItems(theme.variables.visitorsLegend);
|
||||
});
|
||||
|
||||
forkJoin(
|
||||
forkJoin([
|
||||
this.visitorsAnalyticsChartService.getInnerLineChartData(),
|
||||
this.visitorsAnalyticsChartService.getOutlineLineChartData(),
|
||||
this.visitorsAnalyticsChartService.getPieChartData(),
|
||||
)
|
||||
])
|
||||
.pipe(takeWhile(() => this.alive))
|
||||
.subscribe(([innerLine, outerLine, pieChartValue]: [number[], OutlineData[], number]) => {
|
||||
this.visitorsAnalyticsData = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue