mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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.
This commit is contained in:
committed by
Jeremy Elbourn
parent
40773c59be
commit
7ae807e10b
@@ -24,7 +24,6 @@ import {
|
||||
Input,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
Optional,
|
||||
Output,
|
||||
QueryList,
|
||||
ViewChild,
|
||||
@@ -164,8 +163,8 @@ export class MatListOption extends _MatListOptionMixinBase
|
||||
|
||||
constructor(private _element: ElementRef,
|
||||
private _changeDetector: ChangeDetectorRef,
|
||||
/** @docs-private */ @Optional() @Inject(forwardRef(() => MatSelectionList))
|
||||
public selectionList: MatSelectionList) {
|
||||
/** @docs-private */
|
||||
@Inject(forwardRef(() => MatSelectionList)) public selectionList: MatSelectionList) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user