Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

FormsModule should be imported in app.module.shared #986

Closed
@Gimly

Description

@Gimly

I was having trouble understanding why, after passing my solution to Angular 4 (I re-run yeoman from the root of my solution and fixed all the issues), I was getting an error that said:

There is no directive with "exportAs" set to "ngForm"

I was very confused because this error comes when FormsModule isn't correctly imported, but it is imported in app.module.client. After a bit of testing, I figured out that the server-side (probably because of the pre-rendering) actually needed it as an import. I've passed the import to the app.module.shared and it fixed the issue.

Is there any reason for not importing FormsModule from the app.module.shared? Is there something that I should do differently to not have that issue?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions