Angular Content Projection: Everything You Need to Know kzbin.info/www/bejne/mWrFaJ-Zn92IftE Angular ng-template: The Complete Guide to ng-template kzbin.info/www/bejne/m3SWhGyDq5Wti5o
@madpwnz7 ай бұрын
Thanks for the video mate!
@mikhailratner46497 ай бұрын
Interesting...I would never go to such lengths as you showed in the version prior to v18. I would just create a second Input and have an if else statement. However, the v18 version actually looks quite nice. If I understood corrctly, the actual content is by default linked to ng-content and Angular does the rest, which makes it much more concise. I wonder if there are better uses / examples which are more closely to real life. E.g. would it make sense to have some loading spinner as default content!?
@CodeShotsWithProfanis7 ай бұрын
> the actual content is by default linked to ng-content and Angular does the rest Yeah, that's correct. Some real-life scenarios could be: - You can have an image placeholder if content is missing - You can have some default buttons (call to actions) if content is missing