You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
696 B
TypeScript
26 lines
696 B
TypeScript
![]()
3 years ago
|
import { Component, OnInit } from '@angular/core';
|
||
|
import { Observable } from 'rxjs';
|
||
|
|
||
![]()
3 years ago
|
import { Theme } from '../../../enums/theme.enum';
|
||
|
import { ThemeService } from '../../../services/theme.service';
|
||
![]()
3 years ago
|
|
||
|
@Component({
|
||
|
selector: 'app-theme-selector',
|
||
|
templateUrl: './theme-selector.component.html',
|
||
|
styleUrls: ['./theme-selector.component.scss'],
|
||
|
})
|
||
|
export class ThemeSelectorComponent implements OnInit {
|
||
|
public themeEnum = Theme;
|
||
|
public currentTheme: Observable<Theme>;
|
||
|
|
||
|
constructor(private themeService: ThemeService) {}
|
||
|
|
||
|
ngOnInit(): void {
|
||
|
this.currentTheme = this.themeService.theme;
|
||
|
}
|
||
|
|
||
|
public selectTheme(theme: string): void {
|
||
|
this.themeService.selectTheme(theme as Theme);
|
||
|
}
|
||
|
}
|