Load data in the view


#1

I have a problem, 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 when I have the datas?

I have tried onPageWillEnter but it does not work.


#2
<div *ngIf="data">
{{data}}
</div>

I have found the solution. than you.