Skip to content

Lazy loading in Tabs will not render the view correctly #16451

Closed

Description

@zcd0000

Ionic Info

Ionic:

   ionic (Ionic CLI)             : 4.4.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.16
   @angular-devkit/build-angular : 0.10.6
   @angular-devkit/schematics    : 0.7.5
   @angular/cli                  : 7.0.6
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.3, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/cundongzhang/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v8.12.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS
   Xcode             : Xcode 10.1 Build version 10B61

I have updated to the latest in my package.json.

Issue I am having is:

  • The main tab page can be lazy loaded. Attempting to lazy load modules in Tabs will not render the view correctly. Everything is rendering right above the tabs on bottom of the screen. Ion content doesn't show. Ion header will show.
const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: 'list',
        outlet: 'goods',
        loadChildren: '@pages/goods/goods.module#GoodsPageModule'
        // component: GoodsListPage
      },
      {
        path: 'list',
        outlet: 'order',
        loadChildren: '@pages/order/order.module#OrderPageModule'
        // component: OrderListPage
      },
      {
        path: 'index',
        outlet: 'mine',
        loadChildren: '@pages/mine/mine.module#MinePageModule'
        // component: MineIndexPage
      },
      {
        path: '',
        redirectTo: '/tabs/(mine:index)',
        pathMatch: 'full'
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/(goods:list)',
    pathMatch: 'full'
  }
];

wx20181126-182553

Originally posted by @Jscott388 in #15370 (comment) #

Activity

  1. alhilali commented on Nov 26, 2018

    @alhilali

    It seems to be an issue with core.scss
    Try commenting out

    @import "~@ionic/angular/css/core.css";

    in theme/global.scss

  2. zcd0000 commented on Nov 27, 2018

    @zcd0000
    Author

    It seems to be an issue with core.scss
    Try commenting out

    @import "~@ionic/angular/css/core.css";

    in theme/global.scss

    That's worked! Thanks!

  3. alhilali commented on Nov 27, 2018

    @alhilali

    This is only a workaround and I believe it should be fixed

  4. ASHFAQPATWARI commented on Nov 27, 2018

    @ASHFAQPATWARI

    @alhilali Yes, this is an issue and it should stay open.

  5. mhartington commented on Nov 29, 2018

    @mhartington
    Contributor

    This is less of an issue with the CSS and how Angular lazyLoads components . Please see this issue.

    #14566

    Going to close as it is a duplicate, and we need a proper fix in Angular.

  6. ionitron-bot commented on Dec 29, 2018

    @ionitron-bot

    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.

  7. locked and limited conversation to collaborators on Dec 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions