Listens to changes in all of the tabs.
()
| 419 | |
| 420 | /** Listens to changes in all of the tabs. */ |
| 421 | private _subscribeToAllTabChanges() { |
| 422 | // Since we use a query with `descendants: true` to pick up the tabs, we may end up catching |
| 423 | // some that are inside of nested tab groups. We filter them out manually by checking that |
| 424 | // the closest group to the tab is the current one. |
| 425 | this._allTabs.changes.pipe(startWith(this._allTabs)).subscribe((tabs: QueryList<MatTab>) => { |
| 426 | this._tabs.reset( |
| 427 | tabs.filter(tab => { |
| 428 | return tab._closestTabGroup === this || !tab._closestTabGroup; |
| 429 | }), |
| 430 | ); |
| 431 | this._tabs.notifyOnChanges(); |
| 432 | }); |
| 433 | } |
| 434 | |
| 435 | ngOnDestroy() { |
| 436 | this._tabs.destroy(); |
no test coverage detected