Skip to content

Single field sub form interface #123

@ntziolis

Description

@ntziolis

Intent:
Allow for easy implementation of single value (no form group) custom components that implement value accessor interface. This would allow to create smart components like selects / autocompletes that load data themselves that can easily be reused across the application
Think customer / user / country pickers or any commonly used domain specific pickers you can think of.

Issue today:

  • NgxSubFormComponent requires a complex type as generic parameter for class fields / methods to make sense formControlNames etc.
  • Its possible to use NgxSubFormRemapComponent to wrap the single value into a form group and back but it generates boilerplate that is redundant and feels unnecessary especially for new devs joining a project

Feature request:
Create an additional interface that exposes the same functionality as NgxSubFormComponent or NgxSubFormRemapComponent but all methods / fields should be singular formControlName / formControlValue etc.

UPDATE:
https://stackblitz.com/edit/issue-demo-ngx-sub-form-single-value

Notes:

  • checkout the GenericLookupComponent
  • here you can see how the single value is wrapped / unwrapped

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions