I have an input field in Angular 7 for that i use trim () and toLowerCase() the logic works but some times in console it shows .trim() and toLowerCase() of undefined how to handle this errors please help.
<input
oninput="this.value = this.value.toLowerCase()"
(blur)="supplierInfo.name = supplierInfo.name.trim()"
[(ngModel)]="supplierInfo.name"
/>