Sunday, March 26, 2017

using of instead of in when looping through things in TypeScript and Angular 4

*ngFor="let inner of outer.contentKeptInFromOtherEndpoints"

...is probably what you want and not...

 
 

*ngFor="let inner in outer.contentKeptInFromOtherEndpoints"

...as the former will loop through values and the later through keys. By keys I mean the numbers in an array and/or the property names on an object.

No comments:

Post a Comment