JavaScriptServices
JavaScriptServices copied to clipboard
Angular2 forms error when using JavaScriptServices/Universal
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.
I found the solution here... https://github.com/angular/angular/issues/13432