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

Angular2 forms error when using JavaScriptServices/Universal #646

Closed
bencameron00 opened this issue Feb 6, 2017 · 1 comment
Closed

Comments

@bencameron00
Copy link

The problem that I am having is that I get a runtime error if I have a form in a component.

I am importing both FormsModule and ReactiveFormsModule.

My form looks like this...

<form (ngSubmit)="onSubmit()" #loginForm="ngForm" >
...
</form>

The error I am getting is...

Exception: Call to Node module failed with error: Prerendering failed because of error: TypeError: _angular_core.InjectionToken is not a constructor at C:\XXX\ClientApp\dist\main-server.js:35055:42

What have I missed? My form setup worked perfectly when I was not using the JavaScriptServices starter for server side rendering.

@bencameron00
Copy link
Author

I found the solution here... angular/angular#13432

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

No branches or pull requests

1 participant