ngTemplateOutlet: The secret to customisation | Stephen Cooper |

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

ความคิดเห็น • 42

  • @stephencooper9000
    @stephencooper9000 3 ปีที่แล้ว +4

    Corresponding article indepth.dev/posts/1405/ngtemplateoutlet
    Stackblitz: stackblitz.com/edit/ngtemplateoutletcontext?file=src/app/my-selector/my-selector.component.html
    GitHub: github.com/StephenCooper/ngTemplateOutlets
    How to add Typing to ngTemplateOutlet: th-cam.com/video/dau7kQMdH4A/w-d-xo.html

  • @walterluszczyk
    @walterluszczyk 5 ปีที่แล้ว +5

    It is also quite convenient to use ngTemplateOutlet for different layouts on desktop and mobile.

    • @justinnobles3659
      @justinnobles3659 3 ปีที่แล้ว

      This talk helps alot but I am trying to incorporate in my own project which is what you have achieved which is different dynamic layouts using ngTemplateOutlet but can’t seem to wrap my head around it yet. Do you have a stackblitz of using ngTemplateOutlet for different layouts, if not no worries 👌🏼

  • @rtpHarry
    @rtpHarry 5 ปีที่แล้ว +4

    Links at the end of the talk:
    angular.io/api/common/NgTemplateOutlet
    github.com/StephenCooper/ngTemplateOutlets
    stackblitz.com/edit/ngtemplateoutletcontext

  • @Klaster_1
    @Klaster_1 5 ปีที่แล้ว +2

    Great talk, I wish I saw something like this before learning about this stuff myself. For me, ngTemplate was the killer feature of Angular after upgrading from AngularJS, but the same pattern should be possible in 1.7.x too with some custom transclusion directives.

  • @sekiro6969
    @sekiro6969 5 ปีที่แล้ว +12

    I didn't even know that there is such thing in angular

  • @GleKit
    @GleKit 5 ปีที่แล้ว +13

    Excellent explanation of how to use dynamic templates in Angular

  • @TheRuiMonte
    @TheRuiMonte 3 ปีที่แล้ว +1

    Amazing content! I now truly understand this topic which was really confusing to me initially. Thank you so much!

  • @VankataKisyov
    @VankataKisyov 4 ปีที่แล้ว +2

    Thanks for the explanation! Not the easiest syntax to understand and wrap your head around though...

  • @giorgimerabishvili8194
    @giorgimerabishvili8194 5 ปีที่แล้ว +4

    Great talk, absolutely loved it!

  • @collinsk8754
    @collinsk8754 ปีที่แล้ว

    Great presentation - brilliantly succinct and clear! 🙌🙌

  • @andsviat
    @andsviat 3 ปีที่แล้ว +1

    Judging by the reaction of the audience during his talk, I'm pretty sure that he was talking to a wall. PS: Great explanation. Thanks a lot.

  • @sinashafigh786
    @sinashafigh786 ปีที่แล้ว

    Amazing concept and presentation. thank you Stephen for sharing it with us

  • @VankataKisyov
    @VankataKisyov 4 ปีที่แล้ว +2

    I am having troubles understanding what @ContentChild is doing in this particular case?

    • @nickshulzhenko8156
      @nickshulzhenko8156 4 ปีที่แล้ว +1

      Content child is used to get reference for a template from content projection of app-selector.

  • @yaibanoutsukushii
    @yaibanoutsukushii ปีที่แล้ว

    Great concept!

  • @aram5642
    @aram5642 3 ปีที่แล้ว

    If I were to use the shark selector in many modules throughout an app, what would be the best way to provide a unified shark template app-wide? Some kind of ContentChild + directive?

  • @SantoshSingh-nw8yy
    @SantoshSingh-nw8yy 4 ปีที่แล้ว

    Great...good explanation 👍

  • @greg6618
    @greg6618 3 ปีที่แล้ว +2

    Bad example at 6:15. Instead of polluting ngOnInit with
    if (!displayFunc) {
    this.displayFunc = x => x
    }
    We could've use default params right after @Input()
    @Input displayFunc?: string => string = x => x
    Wonder why google engineer doesn't use it in his examples.
    Still great talk, but I hate when speakers
    exaggerate disadvantages of one approach to highlight benefits of the other.

  • @sunmoorthy
    @sunmoorthy 4 ปีที่แล้ว

    nice. I tried on my own. How can I initialize the optionTemplate variable with correct template(my template in different component.ts file)?

  • @rembautimes8808
    @rembautimes8808 3 ปีที่แล้ว

    Great talk

  • @minic00ps
    @minic00ps 5 ปีที่แล้ว

    Stackblitz demo code: stackblitz.com/edit/ngtemplateoutletcontext
    Slides: www.slideshare.net/StephenCooper83/ng-templateoutlets-ac2019
    Twitter twitter.com/SCooperDev

  • @bonnes04
    @bonnes04 4 ปีที่แล้ว

    Thanks...

  • @BigMoneyKirk
    @BigMoneyKirk 8 หลายเดือนก่อน

    I don't like how the code is extremely sectioned as he is attempting to explain this convoluted concept. If the example were more linear, I believe this would be easier to understand. Is there a static piece of code to this exact problem that I can analyze so that I can follow this concept better? Could you have named the files, clearly depicting which file is the parent and which one is the child in this example? The instructor begins to lose me around 10:20

  • @raulrothschild
    @raulrothschild 2 ปีที่แล้ว

    I want to create dynamic ng-tempalte refs, is that possible?
    @ContenChild ('my-dynamic-data')

  • @DebmallyaBhattacharya
    @DebmallyaBhattacharya 4 ปีที่แล้ว +8

    This was such a great topic! I'm gonna change dropdowns in our office project this Monday itself.

    • @colemangael9720
      @colemangael9720 3 ปีที่แล้ว

      I know Im randomly asking but does someone know of a method to get back into an Instagram account?
      I somehow lost my login password. I would appreciate any tricks you can offer me.

    • @sethalden6471
      @sethalden6471 3 ปีที่แล้ว

      @Coleman Gael Instablaster :)

    • @colemangael9720
      @colemangael9720 3 ปีที่แล้ว

      @Seth Alden I really appreciate your reply. I got to the site thru google and I'm trying it out atm.
      Seems to take a while so I will reply here later when my account password hopefully is recovered.

    • @colemangael9720
      @colemangael9720 3 ปีที่แล้ว

      @Seth Alden It did the trick and I now got access to my account again. I'm so happy:D
      Thanks so much you saved my account !

    • @sethalden6471
      @sethalden6471 3 ปีที่แล้ว

      @Coleman Gael you are welcome :D

  • @06kawax
    @06kawax 4 ปีที่แล้ว +2

    I used the same concept to create a reusable angular material table component where actions like( delete, edit, view, etc.. ) are passed using ng-template because they differ depending on the data

  • @elyoaprogrammer
    @elyoaprogrammer 3 ปีที่แล้ว

    Excellent content..thank you for sharing all this content about ngTemplateOutlet very helpful.!

  • @girumhagos4244
    @girumhagos4244 2 ปีที่แล้ว

    Amazing talk, this is a revelation even as an Angular developer. The code you put on Stack blitz makes understanding this even better. Thanks Stephen Cooper and AngularConnect

  • @junaid1464
    @junaid1464 5 ปีที่แล้ว

    why checking in ngOnInit? instead just assign default function right there.

  • @almo679
    @almo679 3 ปีที่แล้ว

    is this a show? you should inform your watchers: "this is a crappy show..."

  • @owlytv
    @owlytv 4 ปีที่แล้ว

    Great talk Stephen! Just wondering if unlike ng-content if that then means you can have parent child events emitted and handled from the control in the template to the parent control without using a service?

  • @MatiasAlibertti
    @MatiasAlibertti 3 ปีที่แล้ว

    Amazing =)