@ViewChildren(TemplateRef) is undefined for <template> elements
If you move console.log('child', this.templates);
to ngAfterViewInit()
then it works.
ngAfterViewInit() {
console.log('child', this.templates);
}
I had expected it to work in ngAfterContentInit()
as well. It seems in this Angular version ngAfterContentInit()
runs before ngAfterViewInit()
. I was sure this was the other way around earlier.
Plunker example