mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +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[];
|
recent: any[];
|
||||||
|
|
||||||
constructor(private userService: UserData) {
|
constructor(private userService: UserData) {
|
||||||
forkJoin(
|
forkJoin([
|
||||||
this.userService.getContacts(),
|
this.userService.getContacts(),
|
||||||
this.userService.getRecentUsers(),
|
this.userService.getRecentUsers(),
|
||||||
)
|
])
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(([contacts, recent]: [Contacts[], RecentUsers[]]) => {
|
.subscribe(([contacts, recent]: [Contacts[], RecentUsers[]]) => {
|
||||||
this.contacts = contacts;
|
this.contacts = contacts;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Component, OnDestroy } from '@angular/core';
|
import { Component, OnDestroy } from '@angular/core';
|
||||||
import { NbThemeService } from '@nebular/theme';
|
import { NbThemeService } from '@nebular/theme';
|
||||||
|
|
||||||
import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
|
import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
|
||||||
import { takeWhile } from 'rxjs/operators';
|
import { takeWhile } from 'rxjs/operators';
|
||||||
import { forkJoin } from 'rxjs';
|
import { forkJoin } from 'rxjs';
|
||||||
|
|
@ -24,19 +23,19 @@ export class ElectricityComponent implements OnDestroy {
|
||||||
themeSubscription: any;
|
themeSubscription: any;
|
||||||
|
|
||||||
constructor(private electricityService: ElectricityData,
|
constructor(private electricityService: ElectricityData,
|
||||||
private themeService: NbThemeService) {
|
private themeService: NbThemeService) {
|
||||||
this.themeService.getJsTheme()
|
this.themeService.getJsTheme()
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(theme => {
|
.subscribe(theme => {
|
||||||
this.currentTheme = theme.name;
|
this.currentTheme = theme.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
forkJoin(
|
forkJoin([
|
||||||
this.electricityService.getListData(),
|
this.electricityService.getListData(),
|
||||||
this.electricityService.getChartData(),
|
this.electricityService.getChartData()
|
||||||
)
|
])
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]] ) => {
|
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]]) => {
|
||||||
this.listData = listData;
|
this.listData = listData;
|
||||||
this.chartData = chartData;
|
this.chartData = chartData;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -27,17 +27,17 @@ export class TemperatureComponent implements OnDestroy {
|
||||||
themeSubscription: any;
|
themeSubscription: any;
|
||||||
|
|
||||||
constructor(private themeService: NbThemeService,
|
constructor(private themeService: NbThemeService,
|
||||||
private temperatureHumidityService: TemperatureHumidityData) {
|
private temperatureHumidityService: TemperatureHumidityData) {
|
||||||
this.themeService.getJsTheme()
|
this.themeService.getJsTheme()
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(config => {
|
.subscribe(config => {
|
||||||
this.theme = config.variables.temperature;
|
this.theme = config.variables.temperature;
|
||||||
});
|
});
|
||||||
|
|
||||||
forkJoin(
|
forkJoin([
|
||||||
this.temperatureHumidityService.getTemperatureData(),
|
this.temperatureHumidityService.getTemperatureData(),
|
||||||
this.temperatureHumidityService.getHumidityData(),
|
this.temperatureHumidityService.getHumidityData(),
|
||||||
)
|
])
|
||||||
.subscribe(([temperatureData, humidityData]: [Temperature, Temperature]) => {
|
.subscribe(([temperatureData, humidityData]: [Temperature, Temperature]) => {
|
||||||
this.temperatureData = temperatureData;
|
this.temperatureData = temperatureData;
|
||||||
this.temperature = this.temperatureData.value;
|
this.temperature = this.temperatureData.value;
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,22 @@ export class ECommerceVisitorsAnalyticsComponent implements OnDestroy {
|
||||||
private alive = true;
|
private alive = true;
|
||||||
|
|
||||||
pieChartValue: number;
|
pieChartValue: number;
|
||||||
chartLegend: {iconColor: string; title: string}[];
|
chartLegend: { iconColor: string; title: string }[];
|
||||||
visitorsAnalyticsData: { innerLine: number[]; outerLine: OutlineData[]; };
|
visitorsAnalyticsData: { innerLine: number[]; outerLine: OutlineData[]; };
|
||||||
|
|
||||||
constructor(private themeService: NbThemeService,
|
constructor(private themeService: NbThemeService,
|
||||||
private visitorsAnalyticsChartService: VisitorsAnalyticsData) {
|
private visitorsAnalyticsChartService: VisitorsAnalyticsData) {
|
||||||
this.themeService.getJsTheme()
|
this.themeService.getJsTheme()
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(theme => {
|
.subscribe(theme => {
|
||||||
this.setLegendItems(theme.variables.visitorsLegend);
|
this.setLegendItems(theme.variables.visitorsLegend);
|
||||||
});
|
});
|
||||||
|
|
||||||
forkJoin(
|
forkJoin([
|
||||||
this.visitorsAnalyticsChartService.getInnerLineChartData(),
|
this.visitorsAnalyticsChartService.getInnerLineChartData(),
|
||||||
this.visitorsAnalyticsChartService.getOutlineLineChartData(),
|
this.visitorsAnalyticsChartService.getOutlineLineChartData(),
|
||||||
this.visitorsAnalyticsChartService.getPieChartData(),
|
this.visitorsAnalyticsChartService.getPieChartData(),
|
||||||
)
|
])
|
||||||
.pipe(takeWhile(() => this.alive))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(([innerLine, outerLine, pieChartValue]: [number[], OutlineData[], number]) => {
|
.subscribe(([innerLine, outerLine, pieChartValue]: [number[], OutlineData[], number]) => {
|
||||||
this.visitorsAnalyticsData = {
|
this.visitorsAnalyticsData = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue