not just with a component's ElementRef.
For example:
@Directive()
class ReferenceDirective {
ReferenceDirective(DynamicComponentLoader dcl, ElementRef ref) {
dcl.loadIntoNewLocation(... ref) // Throws right now
}
}
Workaround:
var elementInjector = internalView(elementRef.parentView)
.elementInjectors[elementRef.boundElementIndex];
var hostComponentElementRef = elementInjector.getHost()
.getElementRef();
I'm denoting P3, because there is a simple enough workaround that can be hidden away in a utility class, but I may bump if others run into the same issue.