1
Angular2,在我的ts中,我有一個控制組,我怎麼能在我的html中使用ngFormControl的雙向綁定選擇?雙向綁定選擇Angular2
form.component.ts
this._reportGeneratingForm = fb.group({
......
selectedGroup: ['']
})
form.component.html
<select class="form-control" ????>
<option>Day</option>
<option>Hour</option>
<option>week</option>
<option>Month</option>
</select>
我可以使用ngFormControl嗎? – Hammer
是的,我試過ngFormControl。這是工作。對於我的情況,我可能不需要數據模型 – Hammer
selected =「selected」不起作用,通過數據綁定覆蓋 – Hammer