-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
NbOverlayContainerAdapter and Lazy Loading #943
Comments
Same issue here. |
Hi Guys! As it mentioned in the documentation, you have to wrap all the entire application in the |
Hello @Tibing , I am using ngx-admin and I have app.component as just while the pages component inherits the layouts and gets me the overall page view. Add your solution to the appendChild issue makes it more compact and gets me a boxed layout. Can you please help me on this ? |
Hi @Vbboi24, could you please create new issue for your question, also as provide reproducible stackblitz? |
Yes Sure, I have already created a issue with ngx-admin repo |
Same issue happening when add nb-select inside Feature module. Not working even with nb-layout wrapping all app. Any help? |
@Tibing Wrapping the app component's router outlet in Is there an alternative for ngx-admin? |
So I tried:
But I still get:
(That's the Firefox equivalent of the Chrome error in the original post.) Modified
|
Workaround: Eager load the module. (I guess that's obvious given the title, but I tinkered for a long time before getting there!) Now |
@Mayocampo hello bro, did you find a solution for this bug? |
I had the same issue with a nested child route, had a working I SOLVED it by wrapping the third
Sub child Module
|
Solved this problem by removing the
|
Worked with me Thanks a lot |
And what if we can't wrap the entire application in an We shouldn't have to wrap the entire app in a layout altering component to get overlays to work. This breaks angular material dialogs, which is why I ended up here. There's lot's of issues on this problem. No real solutions IMO. Wrapping the entire app in layout altering components is not a solution. |
this issue still exist with the lazy loading module. |
you need to do the same on the child aswell as i mentioned |
@snakone thanks man, I was struggling with this for the last 4-5 hours |
Hi Team, Kindly suggest proper solution this could be a cause of a lot of users. |
Thumbs up, app.component.html layout.component.html
Unfortunately, Dialog service not working because nebular says "Layout not found" |
Same issue - happen with upgrade from nebular Any fixes/workaround found ? |
Issue type
I'm submitting a bug report
Issue description
Current behavior:
When a lazy loaded module is opened, a
NbOverlayContainerAdapter
gets constructed along with it which wont have itssetContainer()
called. This causes thenbDialog
to fail in_createContainer()
Expected behavior:
setContainer()
should be called, orcreateContainer()
should append to document body if container undefinedSteps to reproduce:
Related code:
Please try to open the dialog from the lazy loaded module,
sm
and check stackblitz console.https://stackblitz.com/edit/nebular-overlay-container-adapter-bug
Other information:
Console logs:
ERROR TypeError: Cannot read property 'appendChild' of undefined at NbOverlayContainerAdapter._createContainer (theme.umd.js:1907) at NbOverlayContainerAdapter.OverlayContainer.getContainerElement (overlay-container.ts:40) at NbOverlay.createHostElement (theme.umd.js:1289) at NbOverlay.create (theme.umd.js:1246) at NbOverlayService.create (theme.umd.js:1859) at NbDialogService.createOverlay (theme.umd.js:12724) at NbDialogService.open (theme.umd.js:12714) at LcmpComponent.openDialog (VM4956 lcmp.component.ts:21) at Object.eval [as handleEvent] (LcmpComponent.html:1) at handleEvent (view.ts:138)
npm, node, OS, Browser
Angular, Nebular
What I have observed is that, only when
NbLayout
is constructed you call thesetContainer()
Also I dont get consistent behavior when i wrap lazy-component with NbLayout
Please look into this issue :)
The text was updated successfully, but these errors were encountered: