HTML:
<mat-form-field>
<mat-label>Choose terms</mat-label>
<mat-select [formControl]="termlist" multiple>
<mat-option required *ngFor="let term of terms" [value]="term.termName"
>
{{term.termName}}
</mat-option>
</mat-select>
</mat-form-field>
<button mat-flat-button color="primary"
(click)="openSelectComponent()">Continue</button>
Файл машинописного текста:
termlist = new FormControl();
terms: Term;
constructor(private termHttpService: TermHttpService, private router:
Router) { }
ngOnInit() {
this.termHttpService.get().subscribe(result => {
this.terms = result;
console.log(result);
});
}
openSelectComponent() {
this.router.navigate(['/termselected'])
}
}
Итак, суть в том, как получить значения из множественного выбора (условия) и передать их следующему компоненту?
Итак, данные отсюда:
https://gyazo.com/49bbcddf17bee2f44d7a1a4579568ee0
Как мне попасть в эти выбранные значения?