DebugElement

class DebugElement extends DebugNode { constructor(nativeNode: any, parent: any, _debugContext: DebugContext) name: string properties: {...} attributes: {...} classes: {...} styles: {...} childNodes: DebugNode[] nativeElement: any get children: DebugElement[] addChild(child: DebugNode) removeChild(child: DebugNode) insertChildrenAfter(child: DebugNode, newChildren: DebugNode[]) insertBefore(refChild: DebugNode, newChild: DebugNode): void query(predicate: Predicate<DebugElement>): DebugElement queryAll(predicate: Predicate<DebugElement>): DebugElement[] queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] triggerEventHandler(eventName: string, eventObj: any) // 继承自 core/DebugNode constructor(nativeNode: any, parent: DebugNode | null, _debugContext: DebugContext) nativeNode: any listeners: EventListener[] parent: DebugElement | null get injector: Injector get componentInstance: any get context: any get references: {...} get providerTokens: any[] }

构造函数

constructor(nativeNode: any, parent: any, _debugContext: DebugContext)

参数

nativeNode

Type: any.

parent

Type: any.

_debugContext

Type: DebugContext.

属性

属性名类型说明
name
properties
attributes
classes
styles
childNodes
nativeElement
children只读

方法

addChild(child: DebugNode)

参数

child

Type: DebugNode.

removeChild(child: DebugNode)

参数

child

Type: DebugNode.

insertChildrenAfter(child: DebugNode, newChildren: DebugNode[])

参数

child

Type: DebugNode.

newChildren

Type: DebugNode[].

insertBefore(refChild: DebugNode, newChild: DebugNode): void

参数

refChild

Type: DebugNode.

newChild

Type: DebugNode.

返回值

void

query(predicate: Predicate<DebugElement>): DebugElement

参数

predicate

Type: Predicate.

返回值

DebugElement

queryAll(predicate: Predicate<DebugElement>): DebugElement[]

参数

predicate

Type: Predicate.

返回值

DebugElement[]

queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[]

参数

predicate

Type: Predicate.

返回值

DebugNode[]

triggerEventHandler(eventName: string, eventObj: any)

参数

eventName

Type: string.

eventObj

Type: any.