Главная
portfolio designers contact

Troubleshooting

No value accessor for form control

December 27th, 2017

Error: No value accessor for form control with name: ‘myControlName’

It works fine in the app but tests show errors.

Solution: most likely your spec.ts does not import the right module that wraps a form control, like Calendar or Checkbox.

You need

 

import { CheckboxModule } from 'primeng/primeng';
AND also in the test bed
 beforeEach(async(() => {

    TestBed.configureTestingModule({

      imports: [CheckboxModule, ...],