Import symbols from @angular/cdk/collections
UniqueSelectionDispatcher
Class to coordinate unique selection based on name. Intended to be consumed as an Angular service. This service is needed because native radio change events are only fired on the item currently being selected, and we still need to uncheck the previous selection.
This service does not store any IDs and names because they may change at any time, so it is less error-prone if they are simply passed through when the events occur.
listen | |
---|---|
Listen for future changes to item selection. |
|
Parameters | |
listener UniqueSelectionDispatcherListener
|
|
Returns | |
() => void
|
Function used to deregister listener |
notify | |
---|---|
Notify other items that selection for the given name has been set. |
|
Parameters | |
id string
|
|
name string
|
|
ArrayDataSource
extends
DataSource
DataSource wrapper for a native array.
connect | |
---|---|
Returns | |
Observable<readonly T[]>
|
|
disconnect |
---|
DataSource
connect | |
---|---|
Connects a collection viewer (such as a data-table) to this data source. Note that the stream provided will be accessed during change detection and should not directly change values that are bound in template views. |
|
Parameters | |
collectionViewer CollectionViewer
|
|
Returns | |
Observable<readonly T[]>
|
Observable that emits a new value when the data changes. |
disconnect | |
---|---|
Disconnects a collection viewer (such as a data-table) from this data source. Can be used to perform any clean-up or tear-down operations when a view is being destroyed. |
|
Parameters | |
collectionViewer CollectionViewer
|
|
SelectionModel
Class to be used to power selecting one or more options from a list.
Name | Description |
---|---|
|
Event emitted when the value has changed. |
|
Selected values. |
clear | |
---|---|
Clears all of the selected values. |
deselect | |
---|---|
Deselects a value or an array of values. |
|
Parameters | |
...values T[]
|
|
hasValue | |
---|---|
Determines whether the model has a value. |
|
Returns | |
boolean
|
|
isEmpty | |
---|---|
Determines whether the model does not have a value. |
|
Returns | |
boolean
|
|
isMultipleSelection | |
---|---|
Gets whether multiple values can be selected. |
isSelected | |
---|---|
Determines whether a value is selected. |
|
Parameters | |
value T
|
|
Returns | |
boolean
|
|
select | |
---|---|
Selects a value or an array of values. |
|
Parameters | |
...values T[]
|
|
sort | |
---|---|
Sorts the selected values based on a predicate function. |
|
Parameters | |
predicate? (a
|
|
toggle | |
---|---|
Toggles a value between selected and deselected. |
|
Parameters | |
value T
|
|
CollectionViewer
Interface for any component that provides a view of some data collection and wants to provide information regarding the view and any changes made.
Name | Description |
---|---|
|
A stream that emits whenever the |
TreeDataNodeFlattener
Interface for a class that can flatten hierarchical structured data and re-expand the flattened data back into its original structure. Should be used in conjunction with the cdk-tree.
expandFlattenedNodes | |
---|---|
Expands a flattened array of data into its hierarchical form using the provided expansion model. |
|
Parameters | |
nodes T[]
|
|
expansionModel SelectionModel<T>
|
|
Returns | |
T[]
|
|
flattenNodes | |
---|---|
Transforms a set of hierarchical structured data into a flattened data array. |
|
Parameters | |
structuredData any[]
|
|
Returns | |
T[]
|
|
nodeDescendents | |
---|---|
Put node descendants of node in array.
If |
|
Parameters | |
node T
|
|
nodes T[]
|
|
onlyExpandable boolean
|
|
isDataSource | |
---|---|
Checks whether an object is a data source. |
|
Parameters | |
value any
|
|
Returns | |
value is DataSource<any>
|
|
UniqueSelectionDispatcherListener
type UniqueSelectionDispatcherListener = (id: string, name: string) => void;
ListRange
Represents a range of numbers with a specified start and end.
type ListRange = {
start: number;
end: number;
};