0
我有一个组件:在组件级用这样的一个模板添加FormGroup在角2
<td>
<input type="text" placeholder="Date: jour/mois/année" formControlName="dateDebut" >
</td>
<td>
<input type="text" placeholder="Date: jour/mois/année" formControlName="dateFin">
</td>
正如你可能已经猜到了,该组件将在tr
元素应用(selector: '[app-xxx]'
)。
我需要(并希望)[formGroup]
应用于此组件级别。如何做呢?
我想(我是新在此)以下withouth的成功:
@HostBinding('[formGroup]') formGroup: FormGroup;
然后,我将不得不处处添加formgroup指令,我想避免通过使绑定到formGroup整个组件。 –
就像我说的,只是将整个组件绑定在一个标签中,然后绑定一次指令 –