Ionic 3 Slidescreen страница, кажется, не распознается моим кодом - PullRequest
0 голосов
/ 08 января 2019

Я использую ionic 3, и кажется, что код, который я использую, имеет небольшую проблему. Он не направлен на экран слайдов, который я уже создал. Он отображает аутентификацию загрузчика сразу после заставки, но указывает на мою корневую страницу, которая называется TabsPage. Я хочу, чтобы после того, как мой экран-заставка был закончен, он сразу направлялся на мой слайд-экран, если пользователь уже получил доступ к приложению. Любая помощь будет оценена.

Вот мой app.component.ts

@Component({
  templateUrl: 'app.html'
})
export class MyApp {

  rootPage: any = TabsPage;
  loader: any;

  showSplash = true; 

  constructor(public platform: Platform, public loadingCtrl: LoadingController , public storage: Storage, statusBar: StatusBar, splashScreen: SplashScreen) {
    this.presentLoading();
    platform.ready().then(() => {

      statusBar.styleDefault();
      splashScreen.hide();
      timer(3000).subscribe(() => this.showSplash = false)

        this.storage.get('introShown').then((result) => {

          if(result){
            this.rootPage = TabsPage;
          } else {
            this.rootPage = IntroPage;
            this.storage.set('introShown', true);
          }

          this.loader.dismiss();

        });

      });

    }

    presentLoading() {

      this.loader = this.loadingCtrl.create({
        content: "Authenticating..."
      });

      this.loader.present();

    }
}

Вот мой app.module.ts

import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { IonicStorageModule } from '@ionic/storage';
import { MyApp } from './app.component';

@NgModule({
      declarations: [
        MyApp,
        AboutPage,
        ContactPage,
        HomePage,
        TabsPage
      ],
      imports: [
        BrowserModule,
        IonicModule.forRoot(MyApp),
        IonicStorageModule.forRoot(),
      ],
      bootstrap: [IonicApp],
      entryComponents: [
        MyApp,
        AboutPage,
        ContactPage,
        HomePage,
        TabsPage

      ],
      providers: [
        StatusBar,
        SplashScreen,
        Camera,
        {provide: ErrorHandler, useClass: IonicErrorHandler}
      ]
    })
    export class AppModule {}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...