Configure material theme, add material button and input examples

This commit is contained in:
eugene-sinitsyn 2020-03-06 14:21:17 +03:00 committed by Sergey Andrievskiy
parent 70ac56b28a
commit eaf4143731
17 changed files with 198 additions and 40 deletions

View file

@ -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();
}
}