Eager load an ionic Toast Controller
问题 I have this function that listen the internet connection private verifyNetworkConnection() { this.networkService .isNetworkConnected .pipe(distinctUntilChanged()) .subscribe(connected => { if (connected) { // do secret things } else { this.toast.create({ message: 'Sem conexão a internet', showCloseButton: true, duration: 2000, cssClass: ToastClasses.ERROR }).then((res) => res.present()); this.disconnectFromServices(); } }); } And in the else block, i need to show a Toast that says the user