Skip to content

Commit 7ae807e

Browse files
devversionjelbourn
authored andcommitted
fix(list): list-options require a parent selection list (#9899)
Since the `MatListOption` component requires a parent `MatSelectionList`, the DI of the selection list shouldn't be optional. Otherwise there will be runtime exceptions due to an undefined selection list property.
1 parent 40773c5 commit 7ae807e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/list/selection-list.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
Input,
2525
OnDestroy,
2626
OnInit,
27-
Optional,
2827
Output,
2928
QueryList,
3029
ViewChild,
@@ -164,8 +163,8 @@ export class MatListOption extends _MatListOptionMixinBase
164163

165164
constructor(private _element: ElementRef,
166165
private _changeDetector: ChangeDetectorRef,
167-
/** @docs-private */ @Optional() @Inject(forwardRef(() => MatSelectionList))
168-
public selectionList: MatSelectionList) {
166+
/** @docs-private */
167+
@Inject(forwardRef(() => MatSelectionList)) public selectionList: MatSelectionList) {
169168
super();
170169
}
171170

0 commit comments

Comments
 (0)