Currently what I’m doing is pop() the page so the user enters again in order to load the changes, but that’s not how it should be
this is the code:
addCourse(param){
let alert = this.alertCtrl.create({
title: 'Add course',
buttons: [
'Cancel'
]
});
alert.addInput({
name: 'param',
placeholder: 'course name'
});
alert.addButton({
text: 'Add',
handler: data => {
this.schoolAppUsers.insertStudentCourse(this.UserID, data.param).subscribe(res => {
let alert = this.alertCtrl.create({
message: res[0].message,
buttons: [{
text: 'Ok',
handler: () =>{
let navTransition = alert.dismiss();
navTransition.then(() => {
this.navCtrl.pop();
});
return false;
}
}]
});
alert.present();
})
}
});
alert.present();
}
The page has list of courses , so when every time the admin adds a course , it should refresh the page to show the new changes rather than pop() !!