Exploring Angular DOM manipulation techniques using ViewContainerRef
Max, Wizard of the Web


really great tutorial! But some things are still not clear to me!

In regards to TemplateRef and @ViewChild. They might replace and leave the <template>-Tag with a #comment in dem DOM tree. But what happens to the content of the <template>-Tag. In this case:

<template #tpl>
 <span>I am span in template</span>//WHAT HAPPENS TO THE SPAN?

I can’t find the “<span>I am span in template</span>” when I console the templateRef variable (console.dir (this.tpl)), which I reference from @ViewChild(“tpl”) tpl: TemplateRef<any>;

In the logged object tree structure I can not find the excluded “<span>I am span in tempalte</span>” from the template.

This is some confusing part in ng4.