I\'m having a problem with trying to use Angular\'s *ngFor
and *ngIf
on the same element.
When trying to loop through the collection in th
You can also use ng-template
(instead of template. See the note for the caveat of using template tag) for applying both *ngFor and ngIf on the same HTML element. Here is an example where you can use both *ngIf and *ngFor for the same tr element in the angular table.
I love apples!
where fruiArray = ['apple', 'banana', 'mango', 'pineapple']
.
Note:
The caveat of using just the template
tag instead of ng-template
tag is that it throws StaticInjectionError
in some places.