2
votes

We've implemented an Angular component library with elements like custom inputs, textareas, datepicker, and we would like to use them in separate applications.

We implemented a common Angular component library to share our UI components (form elements) between different Angular applications. The form components are working properly inside the library, ControlValueAccessor can work with ngModel and push the proper values to the form. But when we want to use them (the library) in a different Angular application via npm install (because we have created an npm package from this library) the host Angular application give this error message:

"Error: No value accessor for form control with name: 'component name'"

We double checked it: We copy pasted this components to the host application wher we try to use them as child components, and the form components were working well.

It looks like the only problem is using our Angular component library, and the host Angular application can't detect the library's ControlValueAccessor behaviour.

Do you have any ideas or solution to it?

1

1 Answers

0
votes

I know this question is 8 month old but could it be that you installed your own library using npm link? I just stumbled about the same issue here and after lot's of debugging and hair pulling I figured out that it seems to be that npm and symlinks on windows is broken.

After I made a manual install (create folder under node_modules and copy the build files into it) everything from my Angular library works out of the box!

So maybe this can help other people searching for similar problems.