This question already has an answer here:
I have a problem, I am working with Ionic 2 and angular 2.
I have to show some datas in a view but I get these datas from an API in the same page so when I try to show them in the view, they are undefined yet. How can I wait to load the view after getting these datas?
I have tried onPageWillEnter but it does not work.
Thank you in advance.
provider allow you get data from server generate:
ionic generate provider MyProvider --ts
menu.ts
after that use temple with ngFor, ngIf.... to display
You can wrap your template with
*ngIf
When
data
is set, the content will be shown.You can also use the safe-navigation or Elvis operator to avoid error messages
to avoid error messages when
data
isnull