We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70792c7 commit 03c8e74Copy full SHA for 03c8e74
modules/angular2/src/core/compiler/element_injector.ts
@@ -496,8 +496,10 @@ export class ElementInjector extends TreeNode<ElementInjector> implements Depend
496
497
private _debugContext(): any {
498
var p = this._preBuiltObjects;
499
- return new _Context(p.elementRef.nativeElement, p.view.getHostElement().nativeElement,
500
- this._injector);
+ var element = isPresent(p.elementRef) ? p.elementRef.nativeElement : null;
+ var hostRef = p.view.getHostElement();
501
+ var componentElement = isPresent(hostRef) ? hostRef.nativeElement : null;
502
+ return new _Context(element, componentElement, this._injector);
503
}
504
505
private _reattachInjectors(imperativelyCreatedInjector: Injector): void {
0 commit comments