<ion-select> Binding

I got a “Kompetenzbereich” in my “note”-Object and i want the ion-select to automatically select the right “Kompetenzbereich”.

    <ion-label position="stacked">Kompetenzbereich</ion-label>
      <ion-select-option *ngFor="let komp of kompetenzbereiche" [value]="komp">
        {{ komp.komBezeichnung }}

Can you show us the part where you assign to note.lntKompId?

1 Like
  ngDoCheck() {
    this.note = this.exchange.note;

The problem just appears with the <ion-select>, with for example for a string or a date, it works fine.


I asked for where you assign to note.lntKompId, not note. As you seem to be on the road to discovering out, the problem likely lies with JavaScript’s crappy fake OO “support” and the difficulty of comparing objects for equality. I can’t say much further without seeing a MCVE.

1 Like

this is a property of note i get from the backend. i don’t assign it explicit.

i implemented a compareWith for my ion-select, now if i click on the select, the value is selected, but not displayed from the beginning

Finally after a long time searching i found a solution on this post:

The selectedText Attribute in combination with a compareWith Function did solve the problem.