first-npm-package-nicule
Version:
This isi first npm package
18 lines (15 loc) • 629 B
text/typescript
import { BaseInputComponent } from 'first-npm-package-nicule/forms';
import { ControlContainer, NgForm } from '@angular/forms';
import { Component } from '@angular/core';
({
templateUrl: 'select-field.component.html',
styleUrls: ['../mat-field.scss', 'select-field.component.scss'],
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }]
})
export class SelectFieldComponent extends BaseInputComponent {
get selectedValueKey(): string {
return this.field.options
.find(option => option.value === this.ngModel.control.value)
.name;
}
}