• 概要
@angular/platform-browser

By

Class
stable

Predicates for use with DebugElement's query functions.

API

    
      class By {}
    
    

all

Predicate<DebugNode>

Match all nodes.

Usage notes

Example

{@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}

css

Predicate<DebugElement>

Match elements by the given CSS selector.

@paramselectorstring
Usage notes

Example

{@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}

directive

Predicate<DebugNode>

Match nodes that have the given directive present.

@paramtypeType<any>
Usage notes

Example

{@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}

Jump to details