Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
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:
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?)
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)
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.