There is an array:
var stringArray = new Array();
stringArray[1] = 'one';
And ngFor renders nothing in angular when stringArray[0] = undefined.
How do I solve it?
That should work fine. I used ng-container for loop with ngFor and ngIf in a < li >
I was able to replicate that in stackblitz here is the link:
https://stackblitz.com/edit/angular-a2xph9?file=src%2Fapp%2Fapp.component.html
If you want to exclude undefined, null and empty values from your template, you could simply filter your data source:
private source = [
undefined,
null,
"",
"Hello World"
];
public stringArray = source.filter(i => i);
null?