Skip to content

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

@tgdeakin

Description

@tgdeakin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions