Angular video series - #6 ng-content

Опубликовано: 28 Сентябрь 2024
на канале: Code with Sloba
2,252
94

ng-content uses content projection to take HTML of another Angular component and to display it inside itself.

It is a very powerful tool when you are building Angular components intended for reuse. I see it used extensively in frameworks such as ng material.

When do you want to use ng-content?

Anytime you want to inject any kind of HTML into a component, you can do so with ng-content.

************************************************************
0:00 Intro
0:30 When to use ng-content
0:42 Creating first ng-content
1:40 Multi-slot content projection
2:45 Outro

************************************************************
Previous Video:    • Angular video series - #5 Component s...  
Next video:    • Angular video series - #7 Template st...  
Full series:    • Full Angular Course  
************************************************************
Linkedin: link   / slobodan-gajic  
Portfolio: https://bobangajicsm.github.io/portfo...
Twitter:   / _slobodangajic_  
************************************************************