* Gets a stream of events from all the chips within the set. * The stream will automatically incorporate any newly-added chips.
(
mappingFunction: (chip: C) => Observable<T>,
)
| 203 | * The stream will automatically incorporate any newly-added chips. |
| 204 | */ |
| 205 | protected _getChipStream<T, C extends MatChip = MatChip>( |
| 206 | mappingFunction: (chip: C) => Observable<T>, |
| 207 | ): Observable<T> { |
| 208 | return this._chips.changes.pipe( |
| 209 | startWith(null), |
| 210 | switchMap(() => merge(...(this._chips as QueryList<C>).map(mappingFunction))), |
| 211 | ); |
| 212 | } |
| 213 | |
| 214 | /** Checks whether an event comes from inside a chip element. */ |
| 215 | protected _originatesFromChip(event: Event): boolean { |
no outgoing calls
no test coverage detected