0
我在進行測試時點擊按鈕時出現問題。登錄後無法點擊離子菜單按鈕
場景:
在登錄時 - >用戶需要測試並提交 - >用戶被重定向主頁上。但在我的主頁,我不能在「菜單按鈕」,點擊我的Login.ts
if (this.checker == "false" || this.checker == null) {
this.navCtrl.setRoot(LearnertestPage);
} else {
this.navCtrl.setRoot(SplashscreenPage);
}
我test.ts
在警報控制器,我有這個
{
text: 'Yes',
handler: data => {
this.learningStyles.push(
[
{style: "Auditory", value: AudioTotal},
{style: "Logical", value: LogicalTotal},
{style: "Physical", value: PhysicalTotal},
{style: "Social", value: SocialTotal},
{style: "Solitary", value: SolitaryTotal},
{style: "Visual", value: VisualTotal},
{style: "Verbal", value: VerbalTotal}]
);
this.userChecker.update(this.currentUser, { Checker: 'true' });
this.navCtrl.setRoot(SplashscreenPage);
}
}
而且最後我的閃屏或家庭上:
HTML:
<ion-menu [content]="content">
<ion-content>
<ion-item style="background-color:#00aced">
<img src="./assets/img/adapt.png" height="100px" width="350px"/>
</ion-item>
<ion-list>
<button ion-item *ngFor="let p of pages" (click)="openPage(p)">
<ion-icon name="{{p.icon}}"></ion-icon> {{p.title}}
</button>
<button ion-item (click)="doConfirm()">
<ion-icon name="log-out"></ion-icon> Logout
</button>
</ion-list>
在splashscreen.ts
@ViewChild(Nav) nav: Nav;
selectedItem: any;
rootPage: any = ListPage;
selectedTheme:String;
icons: string[];
pages: Array<{ title: string, component: any, icon: string }>
constructor(){
// used for an example of ngFor and navigation
this.pages = [
{ title: 'Home', component: SplashscreenPage, icon: this.icons[0], },
{ title: 'Earth Science', component: LessonPage, icon: this.icons[1] },
{ title: 'Progress', component: ProfilePage, icon: this.icons[2] }
];
}
openPage(page) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
this.nav.setRoot(page.component); }
仍然無法解決我的問題 – AngularNewbie