Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Update/Display ion-select when property is not undefined

$
0
0

@elseCartan wrote:

Hello everybody,
i have to find a way to update my ion-select filling it with options coming from a property when data is arrived from a web service.

I'm doing this but it doesn't work:

<ion-item>
  <ion-label>Data</ion-label>
 <div *ngIf="mydata != undefined">
  <ion-select [(ngModel)]="myproperty">
    <ion-option *ngfor="let item of mydata" value={{item.value}}>{{item.name}}</ion-option>
  </ion-select>
</div>
</ion-item>

mydata is the property with all the values setted after a post to a web service.
In this way i can see only the label. The strange thing is that if i put that code inside a ion-col of a grid, it works. So the gridview continues to update the values inside in automatic?
How can i fix my code without using a gridview?
(I tried also putting a flag in the component to true after mydata is setted and checking the flag on ngIf but with the same result)
Thank you all!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>