QueryList
An unmodifiable list of items that Angular keeps up to date when the state of the application changes.
dirty
truelength
numberfirst
Tlast
Tchanges
Observable<any>Returns Observable of QueryList notifying the subscriber of changes.
get
T | undefinedReturns the QueryList entry at index.
numberT | undefinedmap
U[]filter
2 overloadsSee Array.filter
(value: T, index: number, array: readonly T[]) => value is SS[](value: T, index: number, array: readonly T[]) => unknownT[]find
T | undefinedreduce
USee Array.reduce
(prevValue: U, curValue: T, curIndex: number, array: T[]) => UUUforEach
voidsome
booleantoArray
T[]Returns a copy of the internal results list as an Array.
T[]toString
stringstringreset
voidUpdates the stored data of the query list, and resets the dirty flag to false, so that
on change detection, it will not notify of changes to the queries, unless a new change
occurs.
(any[] | T)[]The query results to store
((value: T) => unknown) | undefinedOptional function for extracting stable object identity from a value
in the array. This function is executed for each element of the query result list while
comparing current query list with the new one (provided as a first argument of the reset
function) to detect if the lists are different. If the function is not provided, elements
are compared as is (without any pre-processing).
voidnotifyOnChanges
voidTriggers a change event by emitting on the changes EventEmitter.
voidsetDirty
voidinternal
voiddestroy
voidinternal
void[Symbol.iterator]
() => Iterator<T, any, any>Description
An unmodifiable list of items that Angular keeps up to date when the state of the application changes.
The type of object that ViewChildren, ContentChildren, and QueryList
provide.
Implements an iterable interface, therefore it can be used in both ES6
javascript for (var i of items) loops as well as in Angular templates with
@for(i of myList; track $index).
Changes can be observed by subscribing to the changes Observable.
*
Usage Notes
Example
@Component({...})class Container {  @ViewChildren(Item) items:QueryList<Item>;}