Angular Content Projection: Everything You Need to Know

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • It's very important to know how to effectively create #angular reusable #components. In this video, you will learn how to achieve this using Content Projection.
    Chapters:
    0:00 Intro
    2:40 Provide an Input in the component
    3:29 Intro to Content Projection using a single slot
    4:53 Use multiple slots
    8:50 Use multiple slots by leveraging the angular directives
    12:03 Learn how to use conditional slots
    19:50 Thank you
    ✨ Code: github.com/profanis/codeShots...
    ******************************************************
    Let's connect
    ******************************************************
    Twitter: / prodromouf
    LinkedIn: / prodromouf
    #angular #learnAngular #angularTutorial #webdeveloper #webdevelopment #frontenddeveloper #components
  • Věda a technologie

Komentáře • 36

  • @ChauTran
    @ChauTran Před rokem +9

    Love it. One comment:
    at 17:35, we can use `ContentChild(CarMainContent, {read: TemplateRef}) carMainContent: TemplateRef` to read the TemplateRef token from the directive instead of having to declare/inject the TemplateRef in the Directive itself.

  • @tamilcodebytes1915
    @tamilcodebytes1915 Před rokem +3

    You are awesome, Profanis! 🥳! Please keep posting the videos. I'm checking your channel daily.

  • @andreymelendez1107
    @andreymelendez1107 Před rokem +1

    Have been looking for this solution for a complete week, very helpful!!!!

  • @sakarsr
    @sakarsr Před rokem +2

    Excellent, you are really a great teacher. Thank you and good health.

  • @AdyNgom
    @AdyNgom Před 9 měsíci +1

    Awesome video - nice pace and a lot packed into such a great example and use case.

  • @kushoyarou
    @kushoyarou Před rokem +2

    Thank you for the always helpful content! Have a great year!

  • @avecesar
    @avecesar Před rokem +2

    Thank you!! I´ve been learning a lot from your videos; very clear, explanatory and useful.

  • @developerfriendly
    @developerfriendly Před rokem +1

    thanks for the video. Angular content projection is a very complicated stuff. I wish Angular could simplify it like react does. In React just put everything inside tags and receive everything with children property in component.

  • @ladimirobaquero6149
    @ladimirobaquero6149 Před 4 měsíci +1

    thanks for your contribution

  • @user-ws9in6yp3b
    @user-ws9in6yp3b Před 6 měsíci +1

    Thank you for this! It helped me a lot!

  • @madpwnz
    @madpwnz Před rokem +1

    Woohooo!!! New video!
    Thank you man!

  • @felsherrr
    @felsherrr Před 6 měsíci

    Brilliant video, I'm glad I clicked on this one first while searching for a vid. But what the hell, even such a small thing in the become sort of a mosnter. And at my work I have a HUGE component built with container ng content and containers. And it is a freaking mess to look at and maintain. I feel like McConaughey who fell into the black hole

  • @user-is5bs8qb4y
    @user-is5bs8qb4y Před rokem +1

    Super clear explanation. Thanks!

  • @unity3dconcepts434
    @unity3dconcepts434 Před 11 měsíci

    Wow.... so many concepts in one video. I loved it. Amazing... Subscribed and liked. 😀

  • @sarahibrahim8943
    @sarahibrahim8943 Před rokem

    thank you

  • @Hariharan0606
    @Hariharan0606 Před rokem +1

    Clearly explained!

  • @andresfelipecano4160
    @andresfelipecano4160 Před rokem +1

    magnific content the this video.

  • @s_gryt
    @s_gryt Před rokem +2

    Cool explanation, liked it.
    That "obj" hint on 3min 06sec, left screen line 4: @Component(obj: { .... - what plugin do you use for that?
    (there are more examples, but I hope my questions makes sense)
    Thank you.

    • @CodeShotsWithProfanis
      @CodeShotsWithProfanis  Před rokem +3

      It's this setting in the settings.json file
      "typescript.inlayHints.parameterNames.enabled": "all"

  • @028-manikandan3
    @028-manikandan3 Před rokem +1

    Thanks bro

  • @kr30000
    @kr30000 Před 6 měsíci

    ...Angular really seems to have the worst templating syntax for composition.

  • @ilhammaghfiro4819
    @ilhammaghfiro4819 Před rokem +1

    Thank you!! this is very awesome