Hellow. I'm using angular 6, and agular material, and I have an array of strings, which I display in a mat-select form field. If an user selects one element, and then another, I need to track what was the previous value and what is the new value.
So far, I've been able to obtain current value using $event.value, but I haven't found a way to store or obtain what the previous value was.
<mat-select placeholder="Choose..." (selectionChange) ="checkTitle($event.value);">
<mat-option *ngFor="let option of Titles; trackBy: trackByFn" [value]="option.title">
{{option.title}}
</mat-option>
</mat-select>
So far, I haven't come up with any ideas as to how solve this problem. Help is appreciated.