sorry for surely a dumb question already answered 1000 times maybe, but I washed the net and forums and didn’t have a CLEAR and SIMPLE answer to my quest
What I want to do :
- use ion-select selector
- use [(NgModel)] to store selected value
- with options in an *ngFor loop
- set as default value selected one of these values
I tried to use “selected” attribute in ion-select-option but does not seem to work
I tried to use the compareWith feature but didn’t manage to understand how to have it fulfill the default value stuff.
I tried to use the “value” attribute in ion-select, didn’t work either
I noticed that when I don’t use the [(NgModel)] stuff, the “value” attribute works just fine to set the default selected value, but I don’t get the utility of having a selector without storing back the selected value (or maybe there is another way, i m not an Angular guru)
Thanks forward for your help, if you could give a clear example, explained like for a 5-year old child it would be perfect.
Have a nice day all