Skip to content

Commit c81362e

Browse files
committed
switch to injector option
1 parent dcb06a7 commit c81362e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/material/select/select.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,17 @@ export class MatSelect
556556
);
557557
}
558558

559-
return new Observable(subscriber =>
560-
runInInjectionContext(this._injector, () => {
561-
afterNextRender(() => {
559+
return new Observable(subscriber => () => {
560+
afterNextRender(
561+
() => {
562562
subscriber.next();
563563
subscriber.complete();
564-
});
565-
}),
566-
).pipe(switchMap(() => this.optionSelectionChanges));
564+
},
565+
{
566+
injector: this._injector,
567+
},
568+
);
569+
}).pipe(switchMap(() => this.optionSelectionChanges));
567570
}) as Observable<MatOptionSelectionChange>;
568571

569572
/** Event emitted when the select panel has been toggled. */

0 commit comments

Comments
 (0)