[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Current behavior
I have a very similar validation form as seen here. But I get errors when using dropdown validation and trying to run karma tests.
I have this code
<form #formId [formGroup]="userform ... >
...
<p-dropdown
...
formControlName="type"
...
</p-dropdown>
...
</form>
When running 'npm test', which runs the angular-cli command 'ng test', i get
Error: No value accessor for form control with name: 'type'
It works fine for input tags that's using formControlName. When i remove formControlName from the p-dropdown, the tests can be executed. I cant really find the problem except for removing the formControlName on the p-dropdown, but i want validation on that data.
Angular cli version: 1.0.X
PrimeNG version: 4.0.X
Language: TypeScript 2.3.2
My bad. I did not import the DropdownModule in my spec.ts file
Had same issue, thanks @mali1488 it helped me ! :)
Thanks alot @mali1488
@mali1488, I am facing same issue...if I add formControl name then it doesn't work. please let me know how did you resolve this issue. As I have already added DropdownModule in AppModule.ts and I am not using spec.ts
Most helpful comment
My bad. I did not import the DropdownModule in my spec.ts file