mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 18:14:07 +03:00
Fix content projector after angular2 update
This commit is contained in:
parent
73ec40072d
commit
5c6d57ab2c
|
@ -29,13 +29,13 @@ export class ContentProjector {
|
||||||
let parentCompRef = parentView.createComponent(componentFactory, null, contextInjector, [projectedNodes]);
|
let parentCompRef = parentView.createComponent(componentFactory, null, contextInjector, [projectedNodes]);
|
||||||
|
|
||||||
// using private property to get AppElement instance
|
// using private property to get AppElement instance
|
||||||
let appElement = (<any>parentView)._element;
|
let viewContainer = (<any>parentView)._element;
|
||||||
appElement.nestedViews = appElement.nestedViews || [];
|
viewContainer.nestedViews = viewContainer.nestedViews || [];
|
||||||
for (let i=0; i < componentRefs.length; i++) {
|
for (let i=0; i < componentRefs.length; i++) {
|
||||||
let compRef = componentRefs[i];
|
let compRef = componentRefs[i];
|
||||||
appElement.nestedViews.push((<any>compRef.hostView).internalView);
|
// attach view to viewContainer change detector
|
||||||
// attach appElement to parentView change detector
|
viewContainer.nestedViews.push((<any>compRef.hostView).internalView);
|
||||||
(<any>compRef.hostView).internalView.addToContentChildren(appElement);
|
(<any>compRef.hostView).internalView.viewContainer = viewContainer;
|
||||||
}
|
}
|
||||||
return parentCompRef;
|
return parentCompRef;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user