Skip to content

Commit dc7467e

Browse files
karajelbourn
authored andcommitted
chore(ivy): add static flag to tab-related static queries (#15238)
1 parent 0cee02b commit dc7467e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

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

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

421-
@ViewChild(MatTabHeader) tabHeader: MatTabHeader;
421+
@ViewChild(MatTabHeader, {static: true}) tabHeader: MatTabHeader;
422422

423423
constructor() {
424424
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
@@ -80,9 +80,9 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
8080
implements AfterContentChecked, AfterContentInit, OnDestroy, CanDisableRipple {
8181

8282
@ContentChildren(MatTabLabelWrapper) _labelWrappers: QueryList<MatTabLabelWrapper>;
83-
@ViewChild(MatInkBar) _inkBar: MatInkBar;
84-
@ViewChild('tabListContainer') _tabListContainer: ElementRef;
85-
@ViewChild('tabList') _tabList: ElementRef;
83+
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;
84+
@ViewChild('tabListContainer', {static: true}) _tabListContainer: ElementRef;
85+
@ViewChild('tabList', {static: true}) _tabList: ElementRef;
8686

8787
/** The distance in pixels that the tab labels should be translated to the left. */
8888
private _scrollDistance = 0;

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ 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}) _explicitContent: TemplateRef<any>;
5353

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

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

0 commit comments

Comments
 (0)