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

connect directive cannot read property controls of undefined as it is checking for this.form and not this.formGroup #102

Open
2 of 9 tasks
tgdeakin opened this issue Sep 28, 2019 · 5 comments

Comments

@tgdeakin
Copy link

tgdeakin commented Sep 28, 2019

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 10.16.3
Typescript Version: 3.5.3
Angular Version: 8.2.2
@angular-redux/store version: 10.0.0
@angular/cli version: (if applicable) 8.2.2
OS: Mac OS Mojave

Expected Behaviour:

Form should connect to redux, like so:

<form connect="myForm" [formGroup]="personalDetailsForm" (ngSubmit)="onSubmit(personalDetailsForm.value)">

Actual Behaviour:

I get this error:

Screenshot 2019-09-28 at 20 19 42

When digging into the source I see this:

Screenshot 2019-09-28 at 20 20 03

From what I can see there's a fix for this to use formGroup rather than form, here, but the source that I have doesn't seem to have this fix, so obviously I am getting an error as it's checking for form and not formGroup.

I am using the latest @angular-redux/forms package, v10.

Am I missing something really silly here?

@tgdeakin tgdeakin changed the title formGroup not mapping to connect directive when using reactive form connect directive cannot read property controls of undefined as it is checking for this.form and not this.formGroup Sep 28, 2019
@tgdeakin tgdeakin changed the title connect directive cannot read property controls of undefined as it is checking for this.form and not this.formGroup connect directive cannot read property controls of undefined as it is checking for this.form and not this.formGroup Sep 28, 2019
@dkowis
Copy link

dkowis commented Dec 2, 2019

I am also having this exact problem with 10.0.0. Very frustrating. Can't do form integration at this point... I haven't found the silly thing you're missing.

@dkowis
Copy link

dkowis commented Dec 2, 2019

I get a slightly different error though:
image

@dkowis
Copy link

dkowis commented Dec 2, 2019

That referenced commit is the 1st commit after releasing 10.0.0.

Could we get a 10.0.1 please?

@dkowis
Copy link

dkowis commented Dec 4, 2019

It seems as though NPM does not support installing a package from git when it's in a monorepo. This is a huge pain in my butt. Does anyone on this thread know how to install that way?

A quick solution would be a 10.0.1. @smithad15 could you knock this out?

@dkowis
Copy link

dkowis commented Dec 4, 2019

https://github.com/angular-redux/platform/blob/master/CONTRIBUTING.md#canary-releases

I just discovered this in the CONTRIBUTING.md, that should be sufficient for now!

@tgdeakin it works great using the canary build. No problems, and I see my FORM_CHANGED action, and my state updates:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants