Content Projection with ng-content (Tutorial 36)

preview_player
Показать описание
Content Projection is one of the most useful feature of angular that helps you to build reusable components.
Sometimes the nature of a component means that the consumer would like to customise the view, the presentation of data, in a unique way for each use case.

We have learnt how to pass data from parent component to child component using @Input and @Output decorator , but that is only limited to pass data from parent to child and child to parent.

Learn about these topics which I have used in this video

ng-content is a predefined directive in angular that is used to implement content projection in angular, if we add ng-content anywhere in our template of our component, the inner content of tags that define our component are then projected on this place.

To implement multiple content projection ,select attribute can be used. You need to pass the selector name(id, class, element selector) in select attribute, then only with that template will projected to that placeholder which has that selector.

This code is available on github:

I have used below FAKE API in demo to illustrate the AsyncSubject:

Follow us on:

#contentprojection #ngcontent #nishasingla
Рекомендации по теме
Комментарии
Автор

Most helpful video on content projection I could find in youtube. Thanks

rahulmukherjee
Автор

although your accent is hard for me to keep on, but because of your clean explanations and good examples I choose your tutorials over and over <3

rojingharooni
Автор

Very nicely explained. Exactly to the point. Thank you.

ashishchopra
Автор

Thanks for the wonderful explanation,

daljeetsingh
Автор

perfectly elaborate each term. Thank you very much for your contribution to my first Angular app :)

evanansh
Автор

I learned new concept this in angular, thanks for awesome videos, ur videos are easy to understand 😊

kishorphawade
Автор

Hi Nisha Singla this is useful content and very easy to understand.... Thanks for posting...

kathiravanramaswamy
Автор

Your only one youtuber to make crystal clear clarity hats off

abhinay
Автор

Thank you so much Nisha. I went through so many tutorials but none of them explained the concepts the way you have explained in few mins.

MrSonu
Автор

Thank you very much for the video, The way of your teaching is very clear and I will understand the concept

NileshGaikwad
Автор

Really good description about how to use content projection. keep it up.

shivramyadav
Автор

It is very usfull lesson and you are a good teacher.

manoharanadimoolam
Автор

Thank you for clear and good teaching skills

tmhowbs
Автор

I won't have to make notes, I will remember since you explained it so well

kajol
Автор

Thank you for providing such a butiful content

saicharan
Автор

You explained in very detailed manner. Thank you

ishagudhka
Автор

Hi Nisha, I appreciate the time you spent on Angular. Could You please explain the topics related to RxJS operators and NgRx. You can handle Angular complicated topics easily.

chiranjeevikadambala
Автор

I love your presentation style, and accent. Watching from South Africa.

compton
Автор

Ma'am Very well explained. Make more videos series on Angular. Thank you!

jilpatel
Автор

Very well explained. right to the point. clear sentences.
I also liked that you covered the basics and a tiny bit more (I mean the select statement).
keep going.

florianuhlmann
join shbcf.ru