linkBy
npm Package | @angular/platform-browser |
---|---|
Module | import { By } from '@angular/platform-browser'; |
Source | platform-browser/src/dom/debug/by.ts |
linkOverview
class By {
static all(): Predicate<DebugElement>
static css(selector: string): Predicate<DebugElement>
static directive(type: Type<any>): Predicate<DebugElement>
}
linkDescription
Predicates for use with DebugElement
's query functions.
linkStatic Members
static css(selector: string): Predicate<DebugElement>
Match elements by the given CSS selector.
linkExample
debugElement.query(By.css('[attribute]'));
static directive(type: Type<any>): Predicate<DebugElement>
Match elements that have the given directive present.
linkExample
debugElement.query(By.directive(MyDirective));