[4.0.0-rc.2] usage of router-outlet instead of ion-router-outlet breaks the layout
See original GitHub issueBug Report
Ionic version: 4.0.0-rc.2
Current behavior: When you create a new project “sidemenu” with the ionic-cli and replace ion-router-outlet with router-outlet, the layout breaks
Expected behavior: since the description of the ion-router-outlet component states to behave exactly like the router-outlet except for the differences for a “stacked-navigation” and for “animations”, the expected behavior would be that using router-outlet does not break the layout
Steps to reproduce:
- Create a “sidemenu” app with ionic cli 4.7.1
- replace ion-router-outlet with router-outlet
Related code: app.component.html
<ion-app>
<ion-split-pane>
<ion-menu>
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
<ion-item [routerDirection]="'root'" [routerLink]="[p.url]">
<ion-icon slot="start" [name]="p.icon"></ion-icon>
<ion-label>
{{p.title}}
</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<router-outlet main><router-outlet> <!-- this line breaks the layout -->
</ion-split-pane>
</ion-app>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[4.0.0-rc.2] usage of router-outlet instead of ion-router ... - GitHub
0-rc.2] usage of router-outlet instead of ion-router-outlet breaks the layout #17140.
Read more >Angular 4 <router-outlet> breaking page layout - Stack Overflow
The app loads the components correctly, but the left sidebar and main content are not scrollable anymore, and the bottom panel is missing,...
Read more >ion-router-outlet | Ionic Documentation
Fired when the component routing to has finished animating. These event tie into Ionic's animation system and can be used to coordinate parts...
Read more >Angular Router: Child Routes, Auxiliary Routes, Master Detail
We will cover both child and auxiliary routes, and we will learn how to setup the very commonly used Master Detail routing scenario....
Read more >RouterOutlet - Angular
The URL for a secondary route uses the following syntax to specify both the primary and ... A router outlet emits an activate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue! You have to add the css by yourself. I think the problem will be that
router-outlet
will not generate a tag that you can style.Another option could be still use
ion-router-outlet
and removing{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
from
app.module.ts
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.