mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
fix(form-inputs): show material inputs
This commit is contained in:
parent
3527b4f214
commit
8a2b24f7bd
2 changed files with 14 additions and 11 deletions
|
|
@ -87,7 +87,7 @@
|
||||||
</nb-card>
|
</nb-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="materialTheme$ | async" class="row">
|
<div *ngIf="showMaterialInputs" class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<ngx-material-inputs></ngx-material-inputs>
|
<ngx-material-inputs></ngx-material-inputs>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,28 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { NbThemeService } from '@nebular/theme';
|
import { NbThemeService } from '@nebular/theme';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-form-inputs',
|
selector: 'ngx-form-inputs',
|
||||||
styleUrls: ['./form-inputs.component.scss'],
|
styleUrls: ['./form-inputs.component.scss'],
|
||||||
templateUrl: './form-inputs.component.html',
|
templateUrl: './form-inputs.component.html',
|
||||||
})
|
})
|
||||||
export class FormInputsComponent {
|
export class FormInputsComponent implements OnInit {
|
||||||
public constructor(private readonly themeService: NbThemeService) {
|
public constructor(private readonly themeService: NbThemeService) {
|
||||||
this.materialTheme$ = this.themeService.onThemeChange()
|
|
||||||
.pipe(map(theme => {
|
|
||||||
const themeName: string = theme?.name || '';
|
|
||||||
return themeName.startsWith('material');
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly materialTheme$: Observable<boolean>;
|
public materialTheme$: Observable<boolean>;
|
||||||
|
|
||||||
public starRate: number = 2;
|
public starRate: number = 2;
|
||||||
public heartRate: number = 4;
|
public heartRate: number = 4;
|
||||||
public radioGroupValue: string = 'This is value 2';
|
public radioGroupValue: string = 'This is value 2';
|
||||||
|
public showMaterialInputs = false;
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.materialTheme$ = this.themeService.onThemeChange()
|
||||||
|
.pipe(tap(theme => {
|
||||||
|
const themeName: string = theme?.name || '';
|
||||||
|
this.showMaterialInputs = themeName.startsWith('material');
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue