Skip to content

build: enforce that the descendants flag is set on all queries #17778

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
Nov 26, 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/material-experimental/mdc-tabs/tab-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {MatInkBar} from './ink-bar';
},
})
export class MatTabHeader extends _MatTabHeaderBase implements AfterContentInit {
@ContentChildren(MatTabLabelWrapper) _items: QueryList<MatTabLabelWrapper>;
@ContentChildren(MatTabLabelWrapper, {descendants: false}) _items: QueryList<MatTabLabelWrapper>;
@ViewChild('tabListContainer', {static: true}) _tabListContainer: ElementRef;
@ViewChild('tabList', {static: true}) _tabList: ElementRef;
@ViewChild('nextPaginator') _nextPaginator: ElementRef<HTMLElement>;
Expand Down
2 changes: 1 addition & 1 deletion src/material/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel<MatMenuItem>
* @deprecated
* @breaking-change 8.0.0
*/
@ContentChildren(MatMenuItem) items: QueryList<MatMenuItem>;
@ContentChildren(MatMenuItem, {descendants: false}) items: QueryList<MatMenuItem>;

/**
* Menu content that will be rendered lazily.
Expand Down
2 changes: 1 addition & 1 deletion src/material/tabs/tab-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export abstract class _MatTabHeaderBase extends MatPaginatedTabHeader implements
},
})
export class MatTabHeader extends _MatTabHeaderBase {
@ContentChildren(MatTabLabelWrapper) _items: QueryList<MatTabLabelWrapper>;
@ContentChildren(MatTabLabelWrapper, {descendants: false}) _items: QueryList<MatTabLabelWrapper>;
@ViewChild(MatInkBar, {static: true}) _inkBar: MatInkBar;
@ViewChild('tabListContainer', {static: true}) _tabListContainer: ElementRef;
@ViewChild('tabList', {static: true}) _tabList: ElementRef;
Expand Down
7 changes: 7 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@
"properties": {
"*": "^(?!\\s*$).+"
}
},
"ContentChildren": {
"argument": 1,
"required": true,
"properties": {
"descendants": "^(true|false)$"
}
}
}, "src/!(a11y-demo|e2e-app|components-examples|universal-app|dev-app)/**/!(*.spec).ts"],
"require-license-banner": [
Expand Down