Skip to content

feat(drag-drop): make CDK_DROP_CONTAINER token public api #12213

@jorroll

Description

@jorroll

Bug, feature request, or proposal:

feature request

What is the expected behavior?

That the CDK_DROP_CONTAINER injection token be public API.

What is the current behavior?

The CDK_DROP_CONTAINER is private api.

What are the steps to reproduce?

See injection token located in cdk-experimental/drag-drop here:
https://github.com/angular/material2/blob/master/src/cdk-experimental/drag-drop/drop-container.ts#L58

What is the use-case or motivation for changing an existing behavior?

Making the CDK_DROP_CONTAINER token public API is necessary in order to support creating a custom drop component which extends CdkDrop. The custom drop component will need to re-provide CDK_DROP_CONTAINER.

i.e

@Component({
  providers: [
    {provide: CDK_DROP_CONTAINER, useExisting: MyCustomListComponent},
  ],
})
export class MyCustomListComponent extends CdkDrop<ListRowItem> {}

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

I'm using

- @angular/core 6.0.7
- @angular/material 6.3.2
- @angular/cdk 6.3.2
- @angular/cdk-experimental 6.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions