私はAngular 2 documentationを探しています。使用方法に関するベストプラクティスを見つける方法はありませんformGroupフォームタグなしでAngular 2のformGroupを使用することはできますか?
あなたが探しているもの
formGroup
をフォームタグで囲む必要がありますか?私は、このコンポーネントを作成しましたformGroup expects a FormGroup instance
:
<div [formGroup]="infoIdentityForm"> <div class="info-identity_title" *ngIf="showTitle"> <div class="group-title">Titre</div> <div class="group-radio"> <span *ngFor="let choice of enumTitleValue"> <label>{{choice}}</label> <input type="radio" formControlName="title" name="title" [id]="choice"/> </span> </div> </div> <div class="info-identity_firstname"> <div class="group-title">Prénom</div> <div class="group-input"> <input type="text" class="form-control" formControlName="firstName" maxlength="25"> </div> </div> <div class="info-identity_lastname"> <div class="group-title">Nom</div> <div class="group-input"> <input type="text" class="form-control" formControlName="lastName" maxlength="25"> </div> </div> </div>
私は
avoid the use of nested form tags
にしようとしている私は、このスタックオーバーフローの質問に見てきた
クールなトリック、素晴らしい仕事です! – Abdel