Skip to content

feature request: mark component @input as required (vs none if not required) #11904

@born2net

Description

@born2net
[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
no way to enforce which are a component's required interface

Expected behavior
get a TypeScript error that component is not satisfying it's minimum interface ti work

What is the motivation / use case for changing the behavior?
I have a VERY complex component with 6 inpits, yet only 1 input is required for it to work with no errors. If I will want to re-use in in 6 months, no way will I remember what is the min input interface. Same for new users of my component.

  • Angular version: 2.0.X
    latest ng2

this is not a breaking change as current inputs (none req, can be left as is) so would be awesome if can be added in a minor release update.

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/ng2Boilerplate
Regards,

Sean

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