<mat-form-field>
<mat-select placeholder="Documents to Export:" [formControl]="documents" multiple>
<mat-option *ngFor="let doc of documentList" [value]="doc.value" (onSelectionChange)="onSelect($event)">{{doc.value}}</mat-option>
<div style="margin: 10px; float: right;">
<button [disabled]="document" mat-raised-button color="primary">Export Images</button>
</div>
</mat-select>
</mat-form-field>
TS:
onSelect(event) {
if (event.isUserInput) {
if (event.source.selected) {
this.selectedDocs.push(event.source.value);
} else {
this.selectedDocs = this.selectedDocs.filter(d => d !== event.source.value)
}
}
console.log(this.selectedDocs);
}
No comments:
Post a Comment