question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.0.0-rc.2] usage of router-outlet instead of ion-router-outlet breaks the layout

See original GitHub issue

Bug 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:

  1. Create a “sidemenu” app with ionic cli 4.7.1
  2. 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
paulstelzercommented, Jan 17, 2019

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

0reactions
ionitron-bot[bot]commented, Feb 18, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found