From 7ae807e10b97f74a6090630946774b05f67ed9ab Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 13 Feb 2018 16:47:23 +0100 Subject: [PATCH] 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. --- src/lib/list/selection-list.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/list/selection-list.ts b/src/lib/list/selection-list.ts index 2b41800f80c..0953e826575 100644 --- a/src/lib/list/selection-list.ts +++ b/src/lib/list/selection-list.ts @@ -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(); }