fix(core): support ngTemplateOutlet in production mode (#12921)

Fixes #12911
This commit is contained in:
Tobias Bosch
2016-11-16 10:00:18 -08:00
committed by Victor Berchet
parent 824ea8406c
commit 8b2dfb2eca
2 changed files with 45 additions and 3 deletions

View File

@ -250,8 +250,10 @@ export abstract class AppView<T> {
if (nextSibling) {
this.visitRootNodesInternal(this._directRenderer.insertBefore, nextSibling);
} else {
this.visitRootNodesInternal(
this._directRenderer.appendChild, this._directRenderer.parentElement(prevNode));
const parentElement = this._directRenderer.parentElement(prevNode);
if (parentElement) {
this.visitRootNodesInternal(this._directRenderer.appendChild, parentElement);
}
}
} else {
this.renderer.attachViewAfter(prevNode, this.flatRootNodes);