Тёмный
No video :(

ng-content in Angular | Directives | Angular 12+ 

procademy
Подписаться 54 тыс.
Просмотров 37 тыс.
50% 1

The ng-content is used when we want to insert the content dynamically inside the component that helps to increase component reusability.
Using ng-content we can pass content inside the component selector and when angular parses that content that appears at the place of ng-content.
Let's understand the use of ng-content with an example.

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@anupamurl
@anupamurl 5 месяцев назад
Thank you for equipping us with the knowledge and skills needed to master Angular development. Looking forward to diving deeper into this powerful framework with your guidance!
@arkoleini
@arkoleini 6 месяцев назад
Great job! I watched ng-content in two other paid courses on Udemy and did not find it as much as simple and clear explanation you did
@AshokaJayasekara19
@AshokaJayasekara19 Год назад
You are explaining the concept very clearly!
@ArifMatubber-km4nv
@ArifMatubber-km4nv Год назад
Thank so much for the clearest explanation
@sohininandi9135
@sohininandi9135 Год назад
crystal clear explanation. 👍
@ahmedm_seada
@ahmedm_seada Год назад
That's a very great example . Thanks
@sona4612
@sona4612 Год назад
Wow ❤️❤️ what a clear explanation 🔥🔥
@monayemhossain5356
@monayemhossain5356 Год назад
Awesome tutorial. Hats off.
@afzalhossain4142
@afzalhossain4142 2 года назад
what a teaching!! wow
@JamesCarlton-vc2vw
@JamesCarlton-vc2vw 3 месяца назад
Great explanation!
@anupamurl
@anupamurl 5 месяцев назад
very clear
@klirmio21
@klirmio21 Год назад
very high tier content tbh
@user-wd9lx2yr7e
@user-wd9lx2yr7e 9 месяцев назад
what's the use of ng-content still the same lines of code is used here, but the code place is changed into component selector, where is code reusability here.
@beksultanomirzak9803
@beksultanomirzak9803 3 месяца назад
omg thank you so much!
@maksat-mad
@maksat-mad Год назад
Great video, thank you!
@phileze_
@phileze_ Год назад
HI there, is there a reason to use ng-content when you can use *ngfor and achieve the same with even lesser code?
@ericculbertson1711
@ericculbertson1711 Год назад
I think having a "brand" variable within the product component, and then providing the 4 brands with an *ngfor is the best way to do this specific example. ng-content would be more flexible if you wanted to sometimes insert different kinds of components for each brand. (e.g. use h1 for iphone, h2 for Samsung, etc)
@Premek00
@Premek00 Год назад
You can think of ng-content as creating a slot for content, where you can insert anything. You can insert , , or custom components and it will work fine.
@user-uw5dl9nk3s
@user-uw5dl9nk3s 7 месяцев назад
will this work when the child component has set the view encapsulation to shadow dom?
@muhidcs
@muhidcs Год назад
Great explanation, thanks!
@bullet7553
@bullet7553 4 месяца назад
Thanks for this bu may we know if there is available source code so it would be much quicker to try?
@CHAIMASOMRANI
@CHAIMASOMRANI Год назад
thank you
@dimon.digital
@dimon.digital Год назад
Thank you very much! 👍
@nijilnmk7775
@nijilnmk7775 9 месяцев назад
super explanation
@boydde3de
@boydde3de Год назад
So, when using ng-content I should not apply the styles of that content to the child component, but to the parent component that injects the content in the child? What if I want to predefine the style of the content in the child component to make it easier to re-use?
@narenk8077
@narenk8077 2 года назад
Why your not said this is content projection?
@ss_GOAT
@ss_GOAT Год назад
Thanks so much!
@yashkumarjani
@yashkumarjani 2 года назад
Helpful Video :)
@kabhishek4961
@kabhishek4961 Год назад
Thank u..
@codewithdoge
@codewithdoge Год назад
You're taking too much time on explaining css and html rather than directly talking about ng content
@tsioryandrianarivony5437
@tsioryandrianarivony5437 Год назад
thank you
Далее