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