Skip to content

chore(ivy): add static flag to tab-related static queries #15238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/tabs/tab-header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class SimpleTabHeaderApp {
tabs: Tab[] = [{label: 'tab one'}, {label: 'tab one'}, {label: 'tab one'}, {label: 'tab one'}];
dir: Direction = 'ltr';

@ViewChild(MatTabHeader) tabHeader: MatTabHeader;
@ViewChild(MatTabHeader, {static: true}) tabHeader: MatTabHeader;

constructor() {
this.tabs[this.disabledTabIndex].disabled = true;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/tabs/tab-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
implements AfterContentChecked, AfterContentInit, OnDestroy, CanDisableRipple {

@ContentChildren(MatTabLabelWrapper) _labelWrappers: QueryList<MatTabLabelWrapper>;
@ViewChild(MatInkBar) _inkBar: MatInkBar;
@ViewChild('tabListContainer') _tabListContainer: ElementRef;
@ViewChild('tabList') _tabList: ElementRef;
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;
@ViewChild('tabListContainer', {static: true}) _tabListContainer: ElementRef;
@ViewChild('tabList', {static: true}) _tabList: ElementRef;

/** The distance in pixels that the tab labels should be translated to the left. */
private _scrollDistance = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tabs/tab-nav-bar/tab-nav-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class MatTabNav extends _MatTabNavMixinBase
private _activeLinkChanged: boolean;
private _activeLinkElement: ElementRef<HTMLElement> | null;

@ViewChild(MatInkBar) _inkBar: MatInkBar;
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;

/** Query list of all tab links of the tab navigation. */
@ContentChildren(forwardRef(() => MatTabLink), {descendants: true})
Expand Down
4 changes: 2 additions & 2 deletions src/lib/tabs/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export class MatTab extends _MatTabMixinBase implements OnInit, CanDisable, OnCh
/**
* Template provided in the tab content that will be used if present, used to enable lazy-loading
*/
@ContentChild(MatTabContent, {read: TemplateRef}) _explicitContent: TemplateRef<any>;
@ContentChild(MatTabContent, {read: TemplateRef, static: true}) _explicitContent: TemplateRef<any>;

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

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