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:
Paul Gschwendtner
2018-02-13 16:47:23 +01:00
committed by Jeremy Elbourn
parent 40773c59be
commit 7ae807e10b
+2 -3
View File
@@ -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();
}