angularangular-clingx-formly

Using ng add to install ngx-formly in an Angular library


Node: 12.16.1

Angular: 9.1.0

Angular CLI: 9.1.0

Problem: I tried to install Formly packages with ng add inside an Angular library, but I got:

$ ng add @ngx-formly/schematics --ui-theme=material
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Specified module does not exist

1) Is it possible to use ng add in a library?

2) And if it isn't, is it possible to install Formly in my Angular library in another way? Can I have troubles if I install Formly with:

npm install @ngx-formly/core --save
npm install @ngx-formly/material --save

Solution

  • 1) It seems like ng add only works when using Angular applications created by Angular CLI. If you try to use ng add in an application with a different sourceRoot or in a library, it doesn't seem to work.

    2) For now, it seems ok to install Formly this way.