本文整理匯總了TypeScript中ng-zorro-antd.NzMessageService.error方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript NzMessageService.error方法的具體用法?TypeScript NzMessageService.error怎麽用?TypeScript NzMessageService.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng-zorro-antd.NzMessageService
的用法示例。
在下文中一共展示了NzMessageService.error方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Observable
return new Observable((observer) => {
if (this.userSrv.isLogin) {
observer.next(true);
observer.complete();
return;
}
this.msg.error('請先登錄');
observer.next(false);
observer.complete();
});
示例2: handleChange
// tslint:disable-next-line:typedef
handleChange({ file, fileList }): void {
const status = file.status;
if (status !== 'uploading') {
console.log(file, fileList);
}
if (status === 'done') {
this.msg.success(`${file.name} file uploaded successfully.`);
} else if (status === 'error') {
this.msg.error(`${file.name} file upload failed.`);
}
}
示例3: Observable
return new Observable((observer) => {
if (this.userSrv.hasRole('admin')) {
observer.next(true);
observer.complete();
return;
}
this.msg.error('授權不足');
observer.next(false);
observer.complete();
});
示例4: setTimeout
this.identity.logout().then(res => {
if (res.Type == AjaxResultType.Success) {
this.msgSrv.success("用戶退出成功");
let url = this.router.url;
if (url.startsWith("/admin/")) {
url = "/home";
}
setTimeout(() => {
this.router.navigateByUrl(url);
}, 100);
return;
}
this.msgSrv.error(`用戶登出失敗:${res.Content}`);
});
示例5: successHandle
this.tenantApi.listCurrent().subscribe(tenants => {
console.log(tenants.data);
if (tenants.data.length <= 0) {
this.message.error('未綁定租戶');
return;
}
if (tenants.data.length <= 1) {
successHandle(tenants.data[0]);
} else {
const modal = this.modal.create({
nzTitle: '選擇公司',
nzWidth: '521px',
nzContent: LoginTenantSelectComponent,
nzComponentParams: {
tenants: tenants.data
},
nzFooter: null
});
modal.afterClose.subscribe((t: Tenant) => {
successHandle(t);
});
}
});
示例6:
}, err => {
this.message.error('用戶名密碼錯誤');
return;
});
示例7: error
public error(message: string) {
this.service.error(message);
}