mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 16:30:13 +01:00
Configure material theme, add material button and input examples
This commit is contained in:
parent
70ac56b28a
commit
eaf4143731
17 changed files with 198 additions and 40 deletions
|
|
@ -1,13 +1,30 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-form-inputs',
|
||||
styleUrls: ['./form-inputs.component.scss'],
|
||||
templateUrl: './form-inputs.component.html',
|
||||
})
|
||||
export class FormInputsComponent {
|
||||
export class FormInputsComponent implements OnInit, OnDestroy {
|
||||
public constructor(private readonly themeService: NbThemeService) {}
|
||||
|
||||
starRate = 2;
|
||||
heartRate = 4;
|
||||
radioGroupValue = 'This is value 2';
|
||||
private readonly subscription: Subscription = new Subscription();
|
||||
|
||||
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