class
final
Predicates for use with DebugElement
's query functions.
class By { static all(): Predicate<DebugNode> static css(selector: string): Predicate<DebugElement> static directive(type: Type<any>): Predicate<DebugNode> }
all() |
---|
Match all nodes. |
Usage NotesExampledebugElement.query(By.all()); |
css() | |||
---|---|---|---|
Match elements by the given CSS selector. | |||
|
selector | string |
debugElement.query(By.css('[attribute]'));
directive() |
---|
Match nodes that have the given directive present. |
Usage NotesExampledebugElement.query(By.directive(MyDirective)); |
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/platform-browser/By