Skip to content
0:00 / 0:00

#angular#ngtemplateoutlet#templateref

ngTemplateOutlet: The secret to customisation | Stephen Cooper | #AngularConnect

AngularConnect

23K subscribers • 4 videos on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.
  • Presented by Stephen Cooper
  • May be out of date. Uploaded 7 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

40K views7 years ago1 recommendation

Web developmentVue, Svelte, Angular and others

Stephen Cooper explains how to use TemplateRefs and ngTemplateOutlet in Angular to build highly customizable components.

Are you trying to create a customisable component with Angular? TemplateRefs and the ngTemplateOutlet directive could be the secret you are missing to achieve full user template customisation. Join us in this talk to see how we transformed our components to achieve this. We will show how TemplateRefs enable you to provide default templates whilst accepting custom display templates that seamlessly integrate into your component. Users can even target variables from your component's internal scope that you choose to expose. Most importantly we will examine the differences between ngTemplateOutlet and ngInclude (Transclusion) and give examples when you should use each approach to template customisation. After this talk you will have all the knowledge and skills you need to start using ngTemplate and ngTemplateOutlet in your own components and wonder how you ever survived without them! About Stephen Cooper Stephen is a developer at G-Research, a quantitative research and technology company. Since introducing the firm to Angular in 2015 he has been a passionate advocate who loves sharing his new found knowledge. Outside of work you will find Stephen enjoy time with his wife and two little explorers. Premier Sponsor: ag-Grid (ag-grid.com).

Why it's here

1 person recommends this

What people say. Recommended as a great presentation for learning how to use ngTemplateOutlet in Angular.

Georgion Stack Overflow • Recommends

On “What is a pTemplate in PrimeNG?”

…h has a ngTemplateOutlet on a <ng-container> inside it. When using that component you can place <ng-template> children between its component selector tags and give them a name. This way you essentially detach UI logic from component logic and achieve greater flexibility. Here is a great presentation which helped me learn how to ngTemplateOutlet: link to this video…