File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,18 @@ const _MatTabMixinBase: CanDisableCtor & typeof MatTabBase =
4545} )
4646export class MatTab extends _MatTabMixinBase implements OnInit , CanDisable , OnChanges , OnDestroy {
4747 /** Content for the tab label given by `<ng-template mat-tab-label>`. */
48- @ContentChild ( MatTabLabel , { static : false } ) templateLabel : MatTabLabel ;
48+ @ContentChild ( MatTabLabel , { static : false } )
49+ get templateLabel ( ) : MatTabLabel { return this . _templateLabel ; }
50+ set templateLabel ( value : MatTabLabel ) {
51+ // Only update the templateLabel via query if there is actually
52+ // a MatTabLabel found. This works around an issue where a user may have
53+ // manually set `templateLabel` during creation mode, which would then get clobbered
54+ // by `undefined` when this query resolves.
55+ if ( value ) {
56+ this . _templateLabel = value ;
57+ }
58+ }
59+ private _templateLabel : MatTabLabel ;
4960
5061 /**
5162 * Template provided in the tab content that will be used if present, used to enable lazy-loading
You can’t perform that action at this time.
0 commit comments