Skip to content

Proposal to make MatOption (its value) typed #19456

Closed

Description

@Wilt

Feature Description

Make MatOption class typed

Use Case

When using MatOption the value is typed any, would be great if it would be possible to make MatOption type specific, could by default be falling back to any:

Proposed solution:

export class MatOption<T = any> implements FocusableOption, AfterViewChecked, OnDestroy {

  //...

  @Input() value: T;

  //...

}

Could provide a PR if that is preferred.

Activity

  1. added
    feature
    needs triage
    on May 27, 2020
  2. added
    P3
    and removed
    needs triage
    on May 27, 2020
  3. jelbourn commented on May 27, 2020

    @jelbourn
    Contributor

    I actually have this on our backlog for all valued components (radio, select, etc).

  4. Wilt commented on Jun 3, 2020

    @Wilt
    ContributorAuthor

    @jelbourn Sounds good!
    Any idea on when will it move from the backlog to a sprint? Typed components would be very useful for checking application/code consistency.

  5. jelbourn commented on Jun 3, 2020

    @jelbourn
    Contributor

    It's hard to say. It's currently number 23 on the backlog behind the remaining work for MDC-based components and test harnesses, but the MDC work is pretty large in scope since it involves updating a lot of Google code internally. We might be able to accept PRs if the changes are strictly non-breaking.

  6. self-assigned this
    on Aug 7, 2020
  7. added a commit that references this issue on Aug 7, 2020
    0d3333b
  8. added a commit that references this issue on Aug 18, 2020
    28181cb
  9. added 4 commits that reference this issue on Sep 28, 2020
    ea66ce2
    919b765
    5cdfe68
    210412b
  10. added a commit that references this issue on Apr 17, 2021
    9f102bd
  11. added a commit that references this issue on Aug 6, 2021
    b3932f7
  12. added 2 commits that reference this issue on Jan 14, 2022
    3565cfa
    74099a0
  13. angular-automatic-lock-bot commented on Feb 14, 2022

    @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.

  14. locked and limited conversation to collaborators on Feb 14, 2022
  15. added a commit that references this issue on Apr 3, 2022
    f62cfdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: material/corefeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions