When a directive is constructor-injected with a ViewContainerRef
, is the ViewContainerRef
referring to the element on which the directive is declared?
For instance,
<p [someDirective]="value"></p>
Consider this scenario with constructor injection:
constructor(vc: ViewContainerRef) {
//The ViewContainerRef is associated with the p element
}
If we call vc.createComponent(...)
now, will the created component be inserted inside the p
element?