|
6 | 6 | * found in the LICENSE file at https://angular.dev/license
|
7 | 7 | */
|
8 | 8 | import {
|
9 |
| - AfterContentChecked, |
10 | 9 | AfterContentInit,
|
11 | 10 | AfterViewInit,
|
12 | 11 | booleanAttribute,
|
@@ -75,10 +74,7 @@ import {_CdkPrivateStyleLoader} from '@angular/cdk/private';
|
75 | 74 | changeDetection: ChangeDetectionStrategy.Default,
|
76 | 75 | imports: [MatRipple, CdkObserveContent],
|
77 | 76 | })
|
78 |
| -export class MatTabNav |
79 |
| - extends MatPaginatedTabHeader |
80 |
| - implements AfterContentChecked, AfterContentInit, OnDestroy, AfterViewInit |
81 |
| -{ |
| 77 | +export class MatTabNav extends MatPaginatedTabHeader implements AfterContentInit, AfterViewInit { |
82 | 78 | /** Whether the ink bar should fit its width to the size of the tab label content. */
|
83 | 79 | @Input({transform: booleanAttribute})
|
84 | 80 | get fitInkBarToContent(): boolean {
|
@@ -194,9 +190,9 @@ export class MatTabNav
|
194 | 190 | this._inkBar = new MatInkBar(this._items);
|
195 | 191 | // We need this to run before the `changes` subscription in parent to ensure that the
|
196 | 192 | // selectedIndex is up-to-date by the time the super class starts looking for it.
|
197 |
| - this._items.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => { |
198 |
| - this.updateActiveLink(); |
199 |
| - }); |
| 193 | + this._items.changes |
| 194 | + .pipe(startWith(null), takeUntil(this._destroyed)) |
| 195 | + .subscribe(() => this.updateActiveLink()); |
200 | 196 |
|
201 | 197 | super.ngAfterContentInit();
|
202 | 198 | }
|
@@ -229,9 +225,7 @@ export class MatTabNav
|
229 | 225 | }
|
230 | 226 | }
|
231 | 227 |
|
232 |
| - // The ink bar should hide itself if no items are active. |
233 | 228 | this.selectedIndex = -1;
|
234 |
| - this._inkBar.hide(); |
235 | 229 | }
|
236 | 230 |
|
237 | 231 | _getRole(): string | null {
|
|
0 commit comments