I want to fetch the option text of the option I selected with the option value also. What necessary changes do I need to make in my below code?
HTML
<mat-select (selectionChange)="changeQuestionValue($event.value)">
<ng-container *ngFor="let q of QuestionCategory">
<mat-option *ngIf="q.isActive" [value]="q.id">{{ q.questionCategoryName }}</mat-option>
</ng-container>
</mat-select>
TS
changeQuestionValue(val) {
return this.questionValue = val;
}
Here in TS am only receiving the q.id
but I also want q.questionCategoryName
.