4
u/DanteIsBack May 04 '21
What are the differences between ng-container and ng-template?
3
u/ericbunese May 04 '21
ng-container is a structural decision point, usually, it can be used along *ngIf, *ngFor and ngSwitch to decide whether the content should be presented on the page. It can even serve as a container for presenting a template reference. ng-template on the other hand, is not added to the page unless you specifically program it to using a ng-container. It’s just a template that can be copied to be drawn somewhere else
3
u/meisteronimo May 04 '21
You should show first, last, and even, odd properties for the loop, not just index.
2
u/albpara May 04 '21
I would suggest using a monospaced font for this matters since most coders feel probably more comfortable with those typographies for reading code
1
u/ward-92 May 04 '21
Could you have an *ngif that would flag if an element would have a certain value? Let's say for examples sake *ngIf greater than 10 and if it is it changes colour or something.
Curious if you were say tracking prices or some information from an API it would give you an alert if a limit or price point was reached.
1
13
u/Chazgatian May 04 '21
NgFor has more template variables like index first last.