• 1000 cra sh на android.
если ngOnInit остается пустым, все работает нормально.
Что не так?
import { Component } from '@angular/core';
import {InAppBrowser} from '@ionic-native/in-app-browser/ngx';
import {Platform} from '@ionic/angular';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
//constructor() {}
constructor(private inAppBrowser : InAppBrowser, private platform : Platform) {}
subscription: any
ngOnInit () {
this.launchSite();
}
launchSite(){
this.inAppBrowser.create(`https:/google.es`,`_self`);
}
exitApp(){
navigator['app'].exitApp();
}
ionViewDidEnter(){
this.subscription = this.platform.backButton.subscribe(async () => {
navigator['app'].exitApp();
});
}
ionViewWillLeave(){
this.subscription.unsubscribe();
}
}