I find myself struggling more than necessary with this task.
Working with Ionic 3/Angular, I began creating a component and realized it wasn't exactly what I needed. Essentially, the class simply triggers an Ionic popup and, if the user clicks 'yes', calls a service.
import { AlertController, NavController } from 'ionic-angular';
import { WSService } from './ws.service';
export class confirmPopup {
constructor(private wsService: WSService ,
private alertCtrl: AlertController,
private navCtrl: NavController) { }
showPopup(){
let popup = this.alertCtrl.create({
title: "Show Popup",
message: "Are you okay today?",
buttons: [
{
text: 'No',
role: 'cancel',
handler: () => {
//Do nothing
}
},
{
text: 'Yes',
handler: () => {
this.wsService.register()
.then( response => {
this.navCtrl.setRoot(AnotherPage);
})
}
}
]
})
popup .present();
}
Now, I am attempting to implement this class in two other components.
After importing it and adding it to the constructor, I encountered the error "Can't resolve all parameters for..."
I'm unsure of what specific steps Angular requires to properly import the class. Any insights?