Closed bayarder closed 2 years ago
Hi @bayarder,
If you are using FormControl :
<ionic-selectable
[canSearch]="true"
formControlName="region"
[items]="regions"
itemValueField="code"
itemTextField="name">
</ionic-selectable>
in your ts file you have just to set the FormControl inside a setTimeout like :
// ...code
public regions: Array<any> = [{code: "1", name: "Region 1"}, {code: "2", name: "Region 2"}];
// ...code
setTimeout(() => {
this.region.setValue({code: "2", name: "Region 2"});
});
You'll get the ion-selectable label updated.
Good luck.
I have an array of values with true or false
question.values = [ { "key": "xx", "value": "yy", "isChecked": false }, { "key": "xx", "value": "yy", "isChecked": true }, { "key": "xx", "value": "yy", "isChecked": false } ]
How to preselect value with true in html code