-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/bottom-sheetfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fixgood first issueThis issue is a good place to start for first time contributors to the projectThis issue is a good place to start for first time contributors to the projecthelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue
Description
Feature Description
In https://material.angular.dev/components/dialog/api#MatDialogConfig we're able to pass in an injector
However, in https://material.angular.dev/components/bottom-sheet/api#MatBottomSheetConfig we're not able to pass in an injector.
It would be nice if we're able to do this such that we can dynamically inject tokens for use in components
Use Case
private myInjection = inject(Injector);
private dialog = inject(MatDialog);
private bottomSheet = inject(MatBottomSheet);
...
const customInjector = Injector.create({
providers: [
{ provide: MY_CUSTOM_DATA, useValue: { myKey: 'myVal' } }
],
parent: this.myInjection
});
if (openDialog) {
const dialogConfig: MatDialogConfig = {
...config,
injector: customInjector
};
this.dialog.open(DialogReference, dialogConfig);
} else {
const sheetConfig: MatBottomSheetConfig = {
...config,
injector: customInjector // <--- this is not available
};
this.bottomSheet.open(SheetReference, sheetConfig);
}
p-arunkumar
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/bottom-sheetfeatureThis issue represents a new feature or feature request rather than a bug or bug fixThis issue represents a new feature or feature request rather than a bug or bug fixgood first issueThis issue is a good place to start for first time contributors to the projectThis issue is a good place to start for first time contributors to the projecthelp wantedThe team would appreciate a PR from the community to address this issueThe team would appreciate a PR from the community to address this issue