mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-21 01:40:13 +01:00
Add material menu icon for material themes
This commit is contained in:
parent
a0af66a5d0
commit
0e4cee0a6a
6 changed files with 43 additions and 44 deletions
|
|
@ -1,30 +1,25 @@
|
|||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-form-inputs',
|
||||
styleUrls: ['./form-inputs.component.scss'],
|
||||
templateUrl: './form-inputs.component.html',
|
||||
})
|
||||
export class FormInputsComponent implements OnInit, OnDestroy {
|
||||
public constructor(private readonly themeService: NbThemeService) {}
|
||||
export class FormInputsComponent {
|
||||
public constructor(private readonly themeService: NbThemeService) {
|
||||
this.materialTheme$ = this.themeService.onThemeChange()
|
||||
.pipe(map(theme => {
|
||||
const themeName: string = theme?.name || '';
|
||||
return themeName.startsWith('material');
|
||||
}));
|
||||
}
|
||||
|
||||
private readonly subscription: Subscription = new Subscription();
|
||||
public readonly materialTheme$: Observable<boolean>;
|
||||
|
||||
public materialThemeActivated: boolean = false;
|
||||
public starRate: number = 2;
|
||||
public heartRate: number = 4;
|
||||
public radioGroupValue: string = 'This is value 2';
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.subscription.add(this.themeService.onThemeChange().subscribe(theme => {
|
||||
const themeName: string = theme?.name || '';
|
||||
this.materialThemeActivated = themeName.startsWith('material');
|
||||
}));
|
||||
}
|
||||
|
||||
public ngOnDestroy(): void {
|
||||
this.subscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue