From 14c2a795eaa2001431fead4fd9f79fd423074126 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 12 Feb 2018 16:19:45 +0100 Subject: [PATCH] fix: list options require a parent selection list * 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 2b41800f80cc..0953e8265751 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(); }