Skip to content

Make MatBottomSheetRef Constructor Injection Use Case Symmetrical  #17011

@oleersoy

Description

@oleersoy

Feature Description

The implementation approach for MatBottomSheetRef is different and not symmetrical to the implementation approach for other angular components.

For example we have to declare a provider with default values. Angular could create the default values for us and the implementation could override when necessary. More here:

https://stackoverflow.com/questions/57846500/nullinjectorerror-no-provider-for-matbottomsheetref

Provide a brief summary of the feature you would like to see.

Defaults provided by angular so that we can we can use MatBottomSheetRef the same way we use all other components / services.

Use Case

Describe the use case(s) that the proposed feature would enable.

Just import the MatBottomSheet module. And use the service in the components:

For example if we import it like this:

import { MatBottomSheetRef } from '@angular/material';

We get the null injection error. This does not happen with any other component.

We have to import it like this:

import { MatBottomSheetRef} from '@angular/material/bottom-sheet';

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: material/bottom-sheetfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions