-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent circular dependency #262
Conversation
Hi, thank you for the PR, but now modal-gallery is not working.
|
Hmm I see, I'll look into it again. |
I finally got to looking at it again. I had forgotten to provide the new service anywhere, so it became tree shaked and never got instantiated. Now it is provided with angular's APP_INITIALIZER token. Tested it, everything seems to work as expected. |
thanks, now it's working. I have a couple of questions:
Is there a specific reason for that?
but I don't seen any method to unsubscribe on close. To avoid memory leak it's a good idea to call unsubscribe. What do you think? |
|
Ok, it's clear. I made a quick test removing
and it's working. This was the reason for my first question. |
ec23c05
to
c851227
Compare
Oh, makes sense, as a service it has not to be provided again. My bad :-). |
You forgot to remove that import I'll integrate also Thank you for your contribution. |
@StenCalDabran I saw that my CI has an issue, because it didn't report an error on PS: I fixed the CI, now it's reporting the error |
Well, that's embarassing 😳 Thank you for the fix! |
No problem man. However, I can't fix the broken test so easely. I understood the idea, but there Is something broken. If you want to help me, I'm open to a solution. The broken Is test Is the attach service. |
Closes #261
This would be the proposed solution as discussed in the issue.
I tried to be consistent regarding test structure and so on, but I'm not sure if I was successful everywhere.
I tried creating a service for handling everything overlay-related, but due to the strong connections between the
overlayRef
and thedialogRef
that did not work to well so for now I only extracted the "attach to overlay" functionality, i.e. the part that was responsible for the circular dependency in the first place.The
open
method is still part of theModalGalleryService
, this includes no breaking changes.