The Wayback Machine - https://web.archive.org/web/20250923173200/https://angular.dev/api/platform-browser/By
    • Overview
@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
HTTPS · web.archive.org
← Home