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

Angular 8 compatibility #188

Closed
paugp opened this issue Jul 12, 2019 · 5 comments

Comments

@paugp
Copy link

commented Jul 12, 2019

Describe the bug

I created an Angular 8 project and when I use propArray doent work and crash.
TypeError: Class constructor ModelWithArray cannot be invoked without 'new'
The same code (and @rxwe/reactive-form-validators version) in Angular 7 works fine.

To Reproduce

Create an angular 8 project.
Create two model, one with @propArray(OtherModel)
Create a form that create the formGroup. (No need to have html form)
this.formGroup = formBuilder.formGroup<ModelWithArray>(new ModelWithArray());
When component load, crash.
TypeError: Class constructor ModelWithArray cannot be invoked without 'new'

Package Version

@rxweb/reactive-form-validators@1.9.1

Browser

Chrome, Firefox, Opera (latest version)

Additional Info

Angular 8 project now uses es2015 as default tsconfig target.
The same code in Angular 7 with es5 works.

@sholkajadav11

This comment has been minimized.

Copy link

commented Jul 14, 2019

@paugp Can you paste your model definition, so that I can guide you the same.
Refer the stackblitz example of angular 8 : https://stackblitz.com/edit/angular-5bhmed?file=src/app/prop-array-add.component.ts

@paugp

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

Its imposible to reproduce with stackblitz. On stackblitz you can't modify teh tsconfig.json file.
The problem is with es2015 target.
Download the stackblitz code and change the tsconfig to compile with es2015 target.

{
  "compilerOptions": {
  …
  "module": "esnext",
  "moduleResolution": "node",
  …
  "target": "es2015",
  …
}

https://blog.angular.io/version-8-of-angular-smaller-bundles-cli-apis-and-alignment-with-the-ecosystem-af0261112a27

@paugp

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

image

@ajayojha

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

@paugp Thanks for sharing the detailed information. I am considering this as a bug and this will be resolved in our next release.

@ajayojha ajayojha added the bug label Aug 11, 2019

@ajayojha ajayojha added this to To do in who is doing what? via automation Aug 11, 2019

@ajayojha

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

The issue has been resolved in 1.9.2 release. Please update your package.

@ajayojha ajayojha closed this Aug 11, 2019

who is doing what? automation moved this from To do to Done Aug 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.