I’m testing the new SplitPane component in v2.2 and it works just fine. But I’m trying to disable the SplitPane on one specific page. When I look at the docs, it looks as if this would be easy, because I can use a boolean in [when].
When I try this in a clean install of a Ionic App (version: 2.2, template: sidemenu), it seems that I can not disable the SplitPane in a Page component.
Either make a service that lets you share the hide / show between components, or use two base layouts.
Service is probably simpler, but setting the ‘when’ like that overrides the intended purpose of making the side menu responsive and hiding at a given screen size.
Thanks @rloui for the examples of using multiple layouts. Very interesting. However, for my specific case I followed your first advice and I created a service. I can now enable/disable the SplitPane on every Page Component.
I also ran into another problem, but I managed to solve that as well. The docs say that I can use a media query or a boolean in the [when] statement. But I want to use both, but of course that does not work:
thanx for this solution works great for my app with login page, on that page i want to hide the menu! If succes on the redirect page i addthis.menuCtrl.enable(true);
I am using Ionic 7 and Angular 16 with ion-split-pane with [when] condition was NOT working!
I had set a variable - isLoggedIn and checked against that to control the menu.
This code in app.component.html is NOT working !
<ion-split-pane contentId=“main” [when]=“isLoggedIn”>
Removed the [when] condition, and in app.component.ts
subscribe to oidc authorization method, check for if authorized and OUILA! It works great!