I'm writing an angular cli 16.2.0 project and i encounter the following problem:
i created a workspace, lets call it test
# ng new test --no-create-application
i created a library project called foo
and an application project called foo-app
using the cli.
# ng g application foo-app
# ng g library foo
then i created a module foofoo
in project foo
:
# ng generate module foofoo --project foo
now i want in my foo-app
project to be able to require modules from the @audiotext
workspace project, in this case the module foofoo, and i want to do that by typing @foo/module_name
so in this case i want this to work:
import('@foo/foofoo');
I tried to add to paths
section of the main tsconfig.json or the foo-app/tsconfig.app.json
:
"paths": {
"@foo/*": ["projects/foo/*"]
},
or
"paths": {
"@foo/*": ["projects/src/public_api"]
},
i also tried adding
"declarations": ["./src/public_api.ts"]
to tsconfig.lib.json of the foo library project
but the results are the same. it can't resolve @foo
.
i feel like i'm shooting in the dark here, just trying things that i google till one thing will work.
any ideas what am i missing ?