connect directive cannot read property controls of undefined as it is checking for this.form and not this.formGroup
tgdeakin opened this issue · comments
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:
When digging into the source I see this:
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?
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.
That referenced commit is the 1st commit after releasing 10.0.0.
Could we get a 10.0.1 please?
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?
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: