My angular2 unit test code fails with the below traceback. I know it's because of not adding formControlName
attribute to the input
tag which was inside a FormGroup.
But I added [ngModelOptions]="{standalone: true}"
to that particular tag.
<md-slide-toggle [(ngModel)]="isAvailable" color="primary" [ngModelOptions]="{standalone: true}">
</md-slide-toggle>
It works perfectly in the main site but on testing, it shows
PhantomJS 2.1.1 (Linux 0.0.0): Executed 39 of 65 (1 FAILED) (0 secs / 1.391 secs)
PhantomJS 2.1.1 (Linux 0.0.0) VehicleFormComponent should create FAILED
Error: Error in ./VehicleFormComponent class VehicleFormComponent - inline template:41:63 caused by: No value accessor for form control with unspecified name attribute in src/test.ts (line 98781)
_throwError@webpack:///~/@angular/forms/src/directives/shared.js:122:0 <- src/test.ts:15986:48