Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import { getThemes } from '@covalent/echarts/base';
@Injectable({ providedIn: 'root' })
export class ChartThemeSelectorService {
selected: string = getThemes()[0];
selectedSubject: BehaviorSubject = new BehaviorSubject(this.selected);
selected$: Observable = this.selectedSubject.asObservable();
select(theme: string): void {
this.selected = theme;
this.selectedSubject.next(theme);
}
}