Skip to content
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

Possible bug with the NgbModal #2509

Closed
Zerokk opened this issue Jul 10, 2018 · 2 comments
Closed

Possible bug with the NgbModal #2509

Zerokk opened this issue Jul 10, 2018 · 2 comments

Comments

@Zerokk
Copy link

@Zerokk Zerokk commented Jul 10, 2018

Bug description:

A page that was working perfectly with the NgbModals, now is having serious (and business-critical) issues that are giving us a huge headache. Basically, our page consists of a Menu component, and a router-outlet which acts as container for all of our apps.

We use this modal in many parts of the app, and it always worked great! Now it only works in the router-outlet, the inner apps. In the Menu component, it doesn't. You can check the problem in the following Stackoverflow question:

https://stackoverflow.com/questions/51256652/ngbmodal-suddenly-stopped-working-in-an-angular-5-project-for-no-reason?noredirect=1#comment89492096_51256652

I think this may be some kind of bug of the NgbModal module, because of the strange behavior of the library not being able to put the content inside the "modal-body" part of it.

Can you guys please take a look at this? I don't understand how this can stop working without having changed anything...

By the way, I'm using the Firefox Quantum navigator, Angular 5. NgBootstrap version 1.0.0-beta.6" (maybe I should try to update it?)

@pkozlowski-opensource

This comment has been minimized.

Copy link
Member

@pkozlowski-opensource pkozlowski-opensource commented Jul 11, 2018

I'm sorry but there is really not enough context / background info to help here. From the SO question I can see that the modal element is properly added to the DOM but the content of the modal is empty. This would indicate that content of the modal is either not passed properly or is empty.

There is really nothing else I can say based on the info provided. Please expand your SO question to show more code around actual call to the modal service. We can continue the discussion in there.

Side note - you should definitively update this library and Angular.

Closing it here as we are not handling support requests through GitHub issues (https://github.com/ng-bootstrap/ng-bootstrap/blob/master/README.md#getting-help)

@Zerokk

This comment has been minimized.

Copy link
Author

@Zerokk Zerokk commented Jul 11, 2018

I found a solution for the problem, although the nature of what caused the problem is still unknown.

I had a method call in a "click" event of the template, which sent a string (for a switch, not big deal) and a template variable (those that are declared with "#" in the template itself). Then, in the method that handles this click, you usually could simply get the second parameter pointing to that variable, which was the modal.

Somehow, that used to work, but now suddenly, that variable seems to be "undefined". So I just used @ViewChild() for accessing those template variables of the modals, and that fixed up everything. But I wonder why this stopped working all of a sudden...

But yeah, anyways, it's not your problem. Probably more an Angular problem or so. Updated the library anyways.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.