Angular 2 rendering template after loading PROMISE with data

I am new to AngularJS 2.0, basically I load the data through Promise in the constructor, but the template is displayed before the promise is resolved.

Any idea how to achieve this?

Thank you, m.

+6
angular
Oct 14 '15 at 22:47
source share
1 answer

You can check data before using it.

 <ul *ngIf="data"> <li *ngFor="let item of data">{{item.value}}</li> </ul> 
+3
Oct. 15 '15 at 10:36
source share



All Articles