
committed by
Misko Hevery

parent
0246b2a2cb
commit
787d1f955f
@ -16,14 +16,13 @@ import {ElementRef} from 'angular2/src/core/compiler/element_ref';
|
||||
export class DebugElement {
|
||||
_elementInjector: ElementInjector;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
constructor(private _parentView: AppView, private _boundElementIndex: number) {
|
||||
this._elementInjector = this._parentView.elementInjectors[this._boundElementIndex];
|
||||
}
|
||||
|
||||
static create(elementRef: ElementRef): DebugElement {
|
||||
return new DebugElement(internalView(elementRef.parentView), elementRef.boundElementIndex);
|
||||
}
|
||||
|
||||
get componentInstance(): any {
|
||||
if (!isPresent(this._elementInjector)) {
|
||||
return null;
|
||||
@ -144,7 +143,7 @@ export class DebugElement {
|
||||
* @return {DebugElement}
|
||||
*/
|
||||
export function inspectElement(elementRef: ElementRef): DebugElement {
|
||||
return DebugElement.create(elementRef);
|
||||
return new DebugElement(internalView(elementRef.parentView), elementRef.boundElementIndex);
|
||||
}
|
||||
|
||||
export function asNativeElements(arr: DebugElement[]): any[] {
|
||||
|
Reference in New Issue
Block a user