Я хочу использовать событие кнопки возврата устройства в ionic4, чтобы что-то сделать, но оно не работает.
my app.component.ts
export class AppComponent {
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar
) {
this.initializeApp();
this.backButtonEvent()
}
backButtonEvent() {
this.platform.backButton.subscribeWithPriority(2, () => {
console.log("clicked to the back button")
});
}
}