Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49246

Ionic 2 - List update reflect in UI

$
0
0

@marcosmachado wrote:

Hi!

I have been working on app and a got some problems.. the biggest is when I run the app the data isn't loaded from the server, and I show a blank list to the user. When I get the data, I can't update the list.

My provider has the code:

requestItems() {
  var sr = new Server();
           ......
           this.http.post(sr.url()+'/get',datapost).map(res => res.json()).subscribe(data => {
           ..........
}

but before the request fill the data, in home.ts the code is:

this.MyProvider.requestItems();
this.items = this.MyProvider.getItems();

and the code above get null items..

is there a way to wait for the items? (a subscribe??)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49246

Trending Articles



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