I am implementing a structural directive in Angular2 . In the docs, I saw what I needed to enter TemplateRefin order to get the template element and ViewContainerRef.
class TestDirective {
constructor( private templateRef : TemplateRef<any>, private viewContainer : ViewContainerRef ) {
}
}
<template [ngIf]="condition">
<p>
Our heroes are true!
</p>
</template>
In this case, I do not understand which element is ViewContainerRef?
user2999287
source
share