Ich versuche, ein dynamisches Formular in meinem Projekt zu erstellen, und ich habe einen Radiobutton. Ich möchte standardmäßig einen von ihnen überprüfen. Ich habe das versucht:Ionic 2: Optionsfeld im Formular, standardmäßig aktiviert
<input *ngIf="fieldForm.value.type == 'date'" type="date" formControlName="field">
<div *ngIf="fieldForm.value.type == 'radio'">
<div *ngFor="let option of fieldForm.value.options.values" >
<label><input type="radio" formControlName="field" value="{{option}}">{{option}}</label>
</div>
<div>
<label><input type="radio" formControlName="field" value="Toto" checked="checked">Toto</label>
</div>
</div>
Aber es funktioniert nicht. Ich verstehe nicht, was ich tun muss. Jemand hat eine Idee?
Können Sie 'checked =" true "' versuchen. –