I'm new to AngularJS 2.0, basically I'm loading data through Promise in constructor, but the template is rendered before the promise is resolved.
Any idea how to achieve this?
Thanks, M.
I'm new to AngularJS 2.0, basically I'm loading data through Promise in constructor, but the template is rendered before the promise is resolved.
Any idea how to achieve this?
Thanks, M.
You can test the data
before using it.
<ul *ngIf="data">
<li *ngFor="let item of data">{{item.value}}</li>
</ul>