1
私はちょうどそのエラーを理解していません、なぜそれはプロパティ 'nav'を読むことができません。私は混乱しています。誰も私を助け、私にエラーを説明することを願って、ここでのエラーは次のとおりです。問題のようですイオン2:ランタイムエラー未知(未定):TypeError:未定義のプロパティ 'nav'を読み取ることができません
import { Component, ViewChild } from '@angular/core';
import { Platform, Nav } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { NativeStorage } from '@ionic-native/native-storage';
import { GooglePlus } from '@ionic-native/google-plus';
import { AccountPage } from '../pages/account/account';
import { LoginPage } from '../pages/login/login';
import { TabsPage } from '../pages/tabs/tabs';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
@ViewChild('nav') nav:Nav;
rootPage:any = TabsPage;
constructor(public nativeStorage: NativeStorage, public googlePlus: GooglePlus, platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
let env = this;
this.googlePlus.trySilentLogin({
'scopes': '', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
'webClientId': 'webClientId.apps.googleusercontent.com', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
'offline': true
})
.then(function(data) {
this.nav.push(AccountPage);
this.splashScreen.hide();
}, function (error){
this.nav.push(LoginPage);
this.splashScreen.hide();
});
statusBar.styleDefault();
});
}
}
何?
はあなたに非常に多くの空気を感謝し、それは私のために動作します。 – Patrick
それを聞いてうれしい! :) – sebaferreras