JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Angular2 forms error when using JavaScriptServices/Universal

Open bencameron00 opened this issue 9 years ago • 1 comments

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 avatar Feb 06 '17 19:02 bencameron00

I found the solution here... https://github.com/angular/angular/issues/13432

bencameron00 avatar Feb 06 '17 21:02 bencameron00