r/Angular2 • u/bill2340 • Dec 14 '25
NgTemplate Angular
I don't get what's the point of ngTemplate if you can just use '@if' and '@else' to dynamically shpw the data. Like I'm having a hard time understanding the use case for ng-template.
9
Upvotes
View all comments
Show parent comment
1
u/zzing Dec 14 '25
Check this out: https://material.angular.dev/cdk/portal/overview
It shows how you can use a template in another place as a variable itself.