Skip to content

Proposal: Make MdDialogConfig generic and use type for data property #4398

Closed

Description

@epelc

Bug, feature request, or proposal:

I propose making MdDialogConfig a generic and use the type for the data property to add better type safety.

See https://github.com/angular/material2/blob/master/src/lib/dialog/dialog-config.ts#L49

Instead of using any you could do

class MdDialogConfig<T> {
  ...
  data?: T;
}

This would give better type safety on the data property.

What is the current behavior?

Data is type any

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

2.0.0-beta.3 cesium-cephalopod (2017-04-07)

Activity

  1. crisbeto commented on May 5, 2017

    @crisbeto
    Member

    This definitely makes sense, however it'll be a breaking change. I think that we should wait until we start supporting TypeScript > 2.3, which introduces default values for generic parameters.

  2. self-assigned this
    on May 5, 2017
  3. added 2 commits that reference this issue on Sep 30, 2017
    2e41711
    a1c6b56
  4. added a commit that references this issue on Oct 11, 2017
    544ac12
  5. added a commit that references this issue on Oct 12, 2017
    b29ac45
  6. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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