-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-selector.component.ts
36 lines (31 loc) · 988 Bytes
/
theme-selector.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Component, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DxSelectBoxModule } from 'devextreme-angular/ui/select-box';
import { DxTextBoxModule } from 'devextreme-angular/ui/text-box';
import { ThemeService } from '../../services/theme.service';
@Component({
selector: 'theme-selector',
templateUrl: 'theme-selector.component.html',
styleUrls: ['./theme-selector.component.scss']
})
export class ThemeSelectorComponent {
currentTheme
themeSource
constructor(private theme: ThemeService) {
this.currentTheme = theme.getTheme()
this.themeSource = theme.getThemeData()
}
onValueChanged(e: any){
this.theme.applyTheme(e.value)
}
}
@NgModule({
imports: [
CommonModule,
DxSelectBoxModule,
DxTextBoxModule
],
declarations: [ ThemeSelectorComponent ],
exports: [ ThemeSelectorComponent ]
})
export class ThemeSelectorModule { }