Skip to content

FormGroup#controls HashMap to be an ES6 Map #12715

@rupebac

Description

@rupebac

I'm submitting a ... (check one with "x")

[ ] 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
I am extending the functionality from FormGroup with my own type. But I have some re-usability problems.

Right now the constructor at FormGroup is like:

constructor( public controls: {[key: string]: AbstractControl}, .....) {}

which does not allow to delegate functions like insert, get and iterate on controls to my derived class. Why not receiving an ES6 Map instead?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

Since "operators overloads" have been declined in Typescript (here), there is no nice way for me to, for instance, keep FormGroup children and FormControl on different objects.

I can submit a PR if you think it makes sense and I have a chance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions