By

By

Experimental Class

Class Overview

class By {
  static all() : Predicate<DebugElement>
  static css(selector: string) : Predicate<DebugElement>
  static directive(type: Type<any>) : Predicate<DebugElement>
}

Class Description

Predicates for use with DebugElement's query functions.

Static Members

all() : Predicate<DebugElement>

Match all elements.

debugElement.query(By.all());
css(selector: string) : Predicate<DebugElement>

Match elements by the given CSS selector.

debugElement.query(By.css('[attribute]'));
directive(type: Type<any>) : Predicate<DebugElement>

Match elements that have the given directive present.

debugElement.query(By.directive(MyDirective));

exported from platform-browser-index, defined in platform-browser/src/dom/debug/by.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/platform-browser/index/By-class.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部