Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Define an Anchor Point Where to Render Dynamic Components in Angular

    angularAngular
    5 - 6

    When we dynamically instantiate a component, we obviously have to know where to place such component within another component’s template.

    For that purpose we will learn how to use a custom directive which exposes a ViewContainerRef and serves us as an anchor point we can then reference later.

    We also explore a second variant, using a simple template variable and a @ViewChild which just exposes the ViewContainerRef.