在“browser.on”上抛出未定义的错误。
public openWithInAppBrowser(url: string) {
let target = "_blank";
var browser = this.theInAppBrowser.create(url, target, this.options);
browser.on('loadstart').subscribe(event => {
console.log(event.url);
});
}
构造函数代码包含:
constructor(public storage: Storage, private router: Router, private navCtrl: NavController, private theInAppBrowser: InAppBrowser,
private toastCtrl: ToastController)
1条答案
按热度按时间jdgnovmf1#
在我的情况下,订阅未定义的错误是由于缺少安装的
npm install cordova-plugin-inappbrowser
。检查https://ionicframework.com/docs/v5/native/in-app-browser也考虑这个答案https://stackoverflow.com/a/44328903/14655526。