Skip to content

Commit ba8d14b

Browse files
karajosephperrott
authored andcommitted
chore(ivy): add static flag to tab-related static queries
1 parent 2f61607 commit ba8d14b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/lib/tabs/tab-header.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ class SimpleTabHeaderApp {
641641
tabs: Tab[] = [{label: 'tab one'}, {label: 'tab one'}, {label: 'tab one'}, {label: 'tab one'}];
642642
dir: Direction = 'ltr';
643643

644-
@ViewChild(MatTabHeader) tabHeader: MatTabHeader;
644+
@ViewChild(MatTabHeader, {static: true}) tabHeader: MatTabHeader;
645645

646646
constructor() {
647647
this.tabs[this.disabledTabIndex].disabled = true;

src/lib/tabs/tab-header.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
9898
implements AfterContentChecked, AfterContentInit, AfterViewInit, OnDestroy, CanDisableRipple {
9999

100100
@ContentChildren(MatTabLabelWrapper) _labelWrappers: QueryList<MatTabLabelWrapper>;
101-
@ViewChild(MatInkBar) _inkBar: MatInkBar;
102-
@ViewChild('tabListContainer') _tabListContainer: ElementRef;
103-
@ViewChild('tabList') _tabList: ElementRef;
101+
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;
102+
@ViewChild('tabListContainer', {static: true}) _tabListContainer: ElementRef;
103+
@ViewChild('tabList', {static: true}) _tabList: ElementRef;
104104
@ViewChild('nextPaginator') _nextPaginator: ElementRef<HTMLElement>;
105105
@ViewChild('previousPaginator') _previousPaginator: ElementRef<HTMLElement>;
106106

src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class MatTabNav extends _MatTabNavMixinBase
8181
private _activeLinkChanged: boolean;
8282
private _activeLinkElement: ElementRef<HTMLElement> | null;
8383

84-
@ViewChild(MatInkBar) _inkBar: MatInkBar;
84+
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;
8585

8686
/** Query list of all tab links of the tab navigation. */
8787
@ContentChildren(forwardRef(() => MatTabLink), {descendants: true})

src/lib/tabs/tab.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ export class MatTab extends _MatTabMixinBase implements OnInit, CanDisable, OnCh
4949
/**
5050
* Template provided in the tab content that will be used if present, used to enable lazy-loading
5151
*/
52-
@ContentChild(MatTabContent, {read: TemplateRef}) _explicitContent: TemplateRef<any>;
52+
@ContentChild(MatTabContent, {read: TemplateRef, static: true})
53+
_explicitContent: TemplateRef<any>;
5354

5455
/** Template inside the MatTab view that contains an `<ng-content>`. */
55-
@ViewChild(TemplateRef) _implicitContent: TemplateRef<any>;
56+
@ViewChild(TemplateRef, {static: true}) _implicitContent: TemplateRef<any>;
5657

5758
/** Plain text label for the tab, used when there is no template label. */
5859
@Input('label') textLabel: string = '';

0 commit comments

Comments
 (0)