ViewQueryMetadata

export class ViewQueryMetadata

exported from angular2/core defined in angular2/src/core/metadata/di.ts (line 236)

Similar to QueryMetadata, but querying the component view, instead of the content children.

Example (live demo)

@Component({...}) @View({ template: ` <item> a </item> <item> b </item> <item> c </item> ` }) class MyComponent { shown: boolean; constructor(private @Query(Item) items:QueryList<Item>) { items.onChange(() => console.log(items.length)); } }

Supports the same querying parameters as QueryMetadata, except descendants. This always queries the whole view.

As shown is flipped between true and false, items will contain zero of one items.

Specifies that a QueryList should be injected.

The injected object is an iterable and observable live list. See QueryList for more details.

Constructor

constructor(_selector: Type | string, {descendants = false, first = false}?: {descendants?: boolean, first?: boolean})

Not Yet Documented

Members

isViewQuery

always true to differentiate it with QueryMetadata.

toString() : string

Not Yet Documented