Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataInput decorator has a type error when used with an array #83

Closed
maxime1992 opened this issue Aug 6, 2019 · 1 comment · Fixed by #87
Closed

DataInput decorator has a type error when used with an array #83

maxime1992 opened this issue Aug 6, 2019 · 1 comment · Fixed by #87
Labels
effort-1: minutes Will only take a few minutes to fix/create released scope: lib Anything related to the library itself state: has PR A PR is available for that issue type: bug/fix This is a bug or at least needs a fix

Comments

@maxime1992
Copy link
Contributor

In the following example:

export class RotorsFormComponent
  extends NgxAutomaticRootFormComponent<Letter[], RotorsForm>
  implements NgxFormWithArrayControls<RotorsForm> {
  @DataInput()
  @Input('rotors')
  dataInput: Letter[] | null | undefined;

We've got an error:

ERROR in apps/enigma/src/app/rotors/rotors-form/rotors-form.component.ts(26,4): error TS2345: Argument of type 'RotorsFormComponent' is not assignable to parameter of type 'NgxRootFormComponent<any, any>'.
      Types of property 'dataInput$' are incompatible.
        Type 'BehaviorSubject<Letter[] | null | undefined>' is not assignable to type 'BehaviorSubject<Required<any> | null | undefined>'.
          Type 'Required<any> | null | undefined' is not assignable to type 'Letter[] | null | undefined'.
            Type 'Required<any>' is missing the following properties from type 'Letter[]': length, pop, push, concat, and 26 more.

This occurs as soon as we use an array on a top level form which is using the DataInput decorator.

@maxime1992 maxime1992 added scope: lib Anything related to the library itself effort-1: minutes Will only take a few minutes to fix/create type: bug/fix This is a bug or at least needs a fix labels Aug 6, 2019
@maxime1992 maxime1992 added the state: has PR A PR is available for that issue label Aug 13, 2019
@maxime1992
Copy link
Contributor Author

🎉 This issue has been resolved in version 2.11.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-1: minutes Will only take a few minutes to fix/create released scope: lib Anything related to the library itself state: has PR A PR is available for that issue type: bug/fix This is a bug or at least needs a fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant