Skip to content

@FormArrayAnnotation() with inheritance #99

@Guillaume-Cornet

Description

@Guillaume-Cornet

Hi,

I have an equivalent of this case in my model.

@ReactiveFormAnnotation()
class Day {
  Day({
    @FormArrayAnnotation() required this.events,
  });

  List<Event> events;
}

@FormGroupAnnotation()
abstract class Event {
  Event({
    @FormControlAnnotation() required this.id,
  });
}

@FormGroupAnnotation()
class PostOp extends Event {
  PostOp({
    required super.id,
  })
}

@FormGroupAnnotation()
class PreOp extends Event {
  PreOp({
    required super.id,
    this.date,
  })

  DateTime date;
}

But i can't make it working with the forms and i don't find in documentation how to use @FormArrayAnnotation with inheritance.

Is this use case possible with reactive_forms ?

ps : apart from this problem, this lib is awesome ! In this project i have a big forms with ~250 different fields to update with many validations and i looking for the more elegant way to do that.

Thanks, Guillaume.

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