尝试重置角度8的下拉列表但不起作用。如果我单击重置按钮,我想显示选择您的城市但不起作用。它带有空白。如何解决此问题。
app.component.ts:
reset(){ his.registrationForm.reset(); }
演示:https://stackblitz.com/edit/angular-select-dropdown-reactive-form-4nvza7?file=src/app/app.component.ts
尝试以下方法:
reset(){ this.registrationForm.get('cityName').setValue(''); }