本文整理汇总了TypeScript中ionic-angular.Loading.present方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Loading.present方法的具体用法?TypeScript Loading.present怎么用?TypeScript Loading.present使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Loading
的用法示例。
在下文中一共展示了Loading.present方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loginUser
loginUser(){
if (!this.loginForm.valid){
console.log(this.loginForm.value);
} else {
this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password)
.then( authData => {
this.navCtrl.setRoot('HomePage');
}, error => {
this.loading.dismiss().then( () => {
let alert = this.alertCtrl.create({
message: error.message,
buttons: [
{
text: "Ok",
role: 'cancel'
}
]
});
alert.present();
});
});
this.loading = this.loadCtrl.create({
dismissOnPageChange: true,
});
this.loading.present();
}
}
示例2: showLoading
private showLoading(): Loading {
let loading: Loading = this.loadingCtrl.create({
content: "Por favor aguarde... Entrando"
});
loading.present();
return loading;
}
示例3: signupUser
/**
* If the form is valid it will call the AuthData service to sign the user up password displaying a loading
* component while the user waits.
*
* If the form is invalid it will just log the form value, feel free to handle that as you like.
*/
signupUser(){
if (!this.signupForm.valid){
console.log(this.signupForm.value);
} else {
this.auth.signup(this.signupForm.value.email, this.signupForm.value.password)
.then(() => {
this.navCtrl.setRoot('HomePage');
}, (error) => {
this.loading.dismiss().then( () => {
var errorMessage: string = error.message;
let alert = this.alertCtrl.create({
message: errorMessage,
buttons: [
{
text: "Ok",
role: 'cancel'
}
]
});
alert.present();
});
});
this.loading = this.loadingCtrl.create({
dismissOnPageChange: true,
});
this.loading.present();
}
}
示例4: uploadPhoto
async uploadPhoto(imageFileUri: any): Promise<void> {
this.myPhoto = imageFileUri;
this.error = null;
this.loading = this.loadingCtrl.create({
content: 'Uploading...'
});
await this.loading.present();
const fileTransfer: FileTransferObject = this.transfer.create();
const fileEntry = await this.file.resolveLocalFilesystemUrl(imageFileUri);
const options: FileUploadOptions = {
fileKey: 'file',
fileName: fileEntry.name,
headers: {}
};
try {
const result = await fileTransfer.upload(imageFileUri, 'http://192.168.178.84:8080/upload', options);
console.log(result.bytesSent);
console.log(result.responseCode);
this.showToast(true);
}
catch (e) {
console.log(e);
this.showToast(false);
}
finally {
this.loading.dismiss();
}
}
示例5:
handler: data => {
this.loading = this.loadingCtrl.create({
dismissOnPageChange: true,
});
if (this.isValid(data.email)) {
this.loading.present();
this.authService.forgotPassword(data.email)
.then(
() => {
this.loading.dismiss().then(() => {
this.meuToastService.present(this.translateService.instant('RESET_PASSWORD.SUCCESS'));
});
}
)
.catch(
err => {
this.loading.dismiss().then(() => {
this.meuToastService.present(this.translateService.instant('RESET_PASSWORD.ERROR'));
});
}
);
} else {
this.meuToastService.present(this.translateService.instant('Invalid Email'));
return false;
}
}
示例6: present
/**
* แสดงข้อความขณะกำลังโหลดข้อมูล
* @param message ข้อความที่แสดง
*
*/
public present(message: string = 'กรุณารอสักครู่...'): void {
this.loading = this.create({
content: message
});
this.loading.present();
}
示例7: scopePresent
public scopePresent(message: string = 'กรุณารอสักครู่...') {
let loading = this.create({
content: message
});
loading.present();
return loading;
}
示例8: loginWithGoogle
loginWithGoogle() {
this.auth.loginWithGoogle().then( authData => {
this.navCtrl.setRoot('HomePage');
console.log(authData);
console.log(authData.user);
let user = {
email: authData.user.email,
displayName: authData.user.displayName,
photoURL: authData.user.photoURL
}
this.postLogin(user);
}, error => {
this.loading.dismiss().then(() => {
let alert = this.alertCtrl.create({
message: error.message,
buttons: [
{
text: "Ok",
role: 'cancel'
}
]
});
alert.present();
});
});
this.loading = this.loadingCtrl.create({
content: "Logging in...",
dismissOnPageChange: true,
});
this.loading.present();
}
示例9: loginUser
loginUser(): void {
if (!this.loginForm.valid) {
console.log(this.loginForm.value);
} else {
this.authProvider.loginUser(this.loginForm.value.email,
this.loginForm.value.password)
.then(authData => {
this.loading.dismiss().then(() => {
this.navCtrl.setRoot(TabsPage);
});
}, error => {
this.loading.dismiss().then(() => {
let alert = this.alertCtrl.create({
message: 'Benutzer und Passwort stimmen nicht überein!',
buttons: [
{
text: "Ok",
role: 'cancel'
}
]
});
alert.present();
});
});
this.loading = this.loadingCtrl.create();
this.loading.present();
}
}
示例10: startLoading
startLoading(loadingCtrl: LoadingController)
{
this.loading = loadingCtrl.create({
content: '请稍候...'
});
this.isLoading = true;
this.loading.present();
}