Прежде всего, вам нужно импортировать загрузочный контроллер.
import { LoadingController } from 'ionic-angular';
в конструкторе , вам необходимо создать его объект.as
constructor(public loadingCtrl: LoadingController){}
Теперь перед вызовом сервиса в методе регистрации необходимо активировать загрузочное сообщение и после результата отклонить его.
signup() {
let loading = this.loadingCtrl.create({
content: 'Please wait...'
});
loading.present();
this.authServiceProvider.postData(this.userData, "signup").then((result) => {
this.responseData = result;
console.log(this.responseData);
if( (JSON.stringify(this.responseData._body)) != "" ) {
loading.dismiss();
this.navCtrl.setRoot(HomePage);
} else {
loading.dismiss();
console.log("User already exists");
}
}, (err) => {
//connection failed error message
console.log("something went wrong");
});
}