On this page
By
class
Predicates for use with DebugElement's query functions.
class By {
  static all(): Predicate<DebugElement>
  static css(selector: string): Predicate<DebugElement>
  static directive(type: Type<any>): Predicate<DebugElement>
}
   Static methods
| 
         
          all() 
          | 
      
|---|
Match all elements.  | 
      
        
          | 
      
Usage NotesExample | 
      
| 
         
          css() 
          | 
      |||
|---|---|---|---|
Match elements by the given CSS selector.  | 
      |||
        
          | 
      
selector | 
            string | 
            
Returns
Usage Notes
Example
debugElement.query(By.css('[attribute]'));| 
         
          directive() 
          | 
      
|---|
Match elements that have the given directive present.  | 
      
Usage NotesExample | 
      
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
 https://v7.angular.io/api/platform-browser/By