angular-redux / form

Keep your Angular2+ form state in Redux
MIT License
41 stars 15 forks source link

Can't bind to 'connect' since it isn't a known property of 'form' #40

Closed agustinvinao closed 7 years ago

agustinvinao commented 7 years ago

This is a...

What toolchain are you using for transpilation/bundling?

Environment

NodeJS Version: 7.10.0 Typescript Version: 2.3.4 Angular Version: 4.3.4 @angular-redux/store version: 6.5.7 @angular/cli version: 1.2.6 OS: OSX 10.12.6

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

Using the module

Actual Behaviour:

Im trying to implement the module in my application but when I try to use:

<form [connect]="['level','detail']">

I got an console error like if the connect directive is not loaded

Can't bind to 'connect' since it isn't a known property of 'form'


### Stack Trace/Error Message:

### Additional Notes:
(optional)

Im defining a module for my component where Im loading the necessary modules:

import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgReduxModule } from '@angular-redux/store'; import { NgReduxFormModule, NgReduxFormConnectModule } from '@angular-redux/form';

import { AnimalFormDialogComponent } from './animal-form.dialog.component';

import { MdDialogModule } from '@angular/material';

@NgModule({ declarations: [ AnimalFormDialogComponent
], imports: [ CommonModule, ReactiveFormsModule, FormsModule, NgReduxFormModule, NgReduxModule, NgReduxFormConnectModule, MdDialogModule ], providers: [], exports: [AnimalFormDialogComponent] }) export class AnimalFormDialogModule { }

smithad15 commented 7 years ago

If you are importing NgReduxFormModule you don't also need to import NgReduxFormConnectModule since it's contents are already included.

agustinvinao commented 7 years ago

I've found the problem, my code is a Module inside another Module, so I need to import NgReduxFormModule on each module.