Angular libraries dependencies between each other #7026
sciborrudnicki
started this conversation in
Feature Requests
Replies: 1 comment
-
To avoid circular dependencies you should extract pieces that are used by both and create the import circle to separate lib. From the code example you provided, I'm not really sure whether is it the case where you extract the Also, as a general rule, I'd recommend setting up linting ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. How can I create reusable angular libraries that depend on each other? I did it already but it's very hard to maintain with
@angular/cli
and withnx
it's impossible because of circular dependency error. I read also To resolve circular dependencies: here but it's not enough for me because my approach works. The first library uses some of the features from the second library, and the second library uses some of the features from the first library. For example:I've created library
callback
that has class and type.Then i've created
error
library that hasValidationError
class.Both libraries have peer dependencies set, for error, it's
callback
for the 'callback' it'serror
. I want to have everything about callback in the librarycallback
and everything about an error in theerror
library. What is the best approach in this situation?Beta Was this translation helpful? Give feedback.
All reactions