@@ -41,7 +41,11 @@ import {BehaviorSubject, Subject} from 'rxjs';
4141import { startWith , takeUntil } from 'rxjs/operators' ;
4242import { ENTER , SPACE } from '@angular/cdk/keycodes' ;
4343import { MAT_TABS_CONFIG , MatTabsConfig } from '../tab-config' ;
44- import { MatPaginatedTabHeader , MatPaginatedTabHeaderItem } from '../paginated-tab-header' ;
44+ import {
45+ MatPaginatedTabHeader ,
46+ MatPaginatedTabHeaderItem ,
47+ normalizeDuration ,
48+ } from '../paginated-tab-header' ;
4549import { CdkObserveContent } from '@angular/cdk/observers' ;
4650import { _CdkPrivateStyleLoader } from '@angular/cdk/private' ;
4751
@@ -89,17 +93,8 @@ export class MatTabNav extends MatPaginatedTabHeader implements AfterContentInit
8993 @Input ( { alias : 'mat-stretch-tabs' , transform : booleanAttribute } )
9094 stretchTabs : boolean = true ;
9195
92- @Input ( )
93- get animationDuration ( ) : string {
94- return this . _animationDuration ;
95- }
96-
97- set animationDuration ( value : string | number ) {
98- const stringValue = value + '' ;
99- this . _animationDuration = / ^ \d + $ / . test ( stringValue ) ? value + 'ms' : stringValue ;
100- }
101-
102- private _animationDuration ! : string ;
96+ /** Duration for the header animation. Will be normalized to milliseconds if no units are set. */
97+ @Input ( { transform : normalizeDuration } ) animationDuration : string = '' ;
10398
10499 /** Query list of all tab links of the tab navigation. */
105100 @ContentChildren ( forwardRef ( ( ) => MatTabLink ) , { descendants : true } )
0 commit comments