I want to edit the filled form but I don't get the value form the drop-down element
<ion-item style="background-color:transparent">
<ion-label required class="label">Class
<span>
<b style="color:red">*</b>
</span>
</ion-label>
<ion-select [selectOptions]="selectOptions1" value="{{class}}" placeholder="Select Class" formControlName="class">
<ion-option *ngFor="let class of plannerDetail.course.class; let i = index" (ionSelect)="setClassIndex(i)" value="{{class.id}}">{{class.course_name}}</ion-option>
</ion-select>
</ion-item>
ts file
placeForm: FormGroup;
class: AbstractControl;
constructor(){
this.placeForm.formBuilder.group({
placeId: [’’, Validators.required],
});
this.placeForm.get(‘class’).setValue(myArray.class);
}
You can create a two-way data binding with
ngModel
like this:.html
.ts
What it basically does is:
.ts
file, it will be changed in template aswellSo you can control the
ion-select
value aswell as your user.