Ionic - List update reflect in UI



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();
 '/get',datapost).map(res => res.json()).subscribe(data => {

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

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

and the code above get null items…

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


Please put the entire code for MyProvider.


Hi @gedarufi!! I solved using Subscribe. Thank you