Angular 爱奥尼亚4号标签路由不变
我使用4个标签。“其他选项卡”页面上的“硬件后退”按钮侦听器。当hardwareBackButton功能运行时,HomeTabPage和其他TabPage图标保持选中状态。但是运行onClick函数没有问题Angular 爱奥尼亚4号标签路由不变,angular,ionic-framework,angular-ui-router,ionic4,angular-router,Angular,Ionic Framework,Angular Ui Router,Ionic4,Angular Router,我使用4个标签。“其他选项卡”页面上的“硬件后退”按钮侦听器。当hardwareBackButton功能运行时,HomeTabPage和其他TabPage图标保持选中状态。但是运行onClick函数没有问题 你能显示html吗? otherTabPage.html <ion-button (click)="onClick()"> Go Home </ion-button> export class OtherTabPage { constructor(priva
你能显示html吗?
otherTabPage.html
<ion-button (click)="onClick()">
Go Home
</ion-button>
export class OtherTabPage {
constructor(private platform: Platform) {
this.hardwareBackButton();
}
hardwareBackButton() {
this.platform.backButton.subscribe(async () => {
this.router.navigateByUrl('/'); // Go to home
});
}
onClick() {
this.router.navigateByUrl('/'); // Go to home
}
}