當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ng-zorro-antd.NzMessageService類代碼示例

本文整理匯總了TypeScript中ng-zorro-antd.NzMessageService的典型用法代碼示例。如果您正苦於以下問題:TypeScript NzMessageService類的具體用法?TypeScript NzMessageService怎麽用?TypeScript NzMessageService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了NzMessageService類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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.`);
   }
 }
開發者ID:SrgGs,項目名稱:ng-zorro-antd,代碼行數:12,代碼來源:drag.ts

示例2: 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}`);
    });
開發者ID:Yizongjishi,項目名稱:osharp-ns20,代碼行數:15,代碼來源:user.component.ts

示例3: handleError

 private handleError(errResp: HttpErrorResponse | any) {
     let errMsg: any;
     if (errResp instanceof HttpErrorResponse) {
         switch (errResp.status) {
             case 401:
                 // handle Unauthorized error and redirect to login page
                 errMsg = '401 Unauthorized';
                 console.log(this.router.url);
                 if (this.router.url !== '/login') {
                     this.router.navigate(['/login']);
                 }
                 break;
             case 403:
                 errMsg = '403 Forbidden';
                 console.log();
                 if (errResp.error['code'] === 1) {
                     this.router.navigate(['/login']);
                 } else {
                     this.message.warning('沒有權限');
                 }
                 break;
             default:
                 // this.message.error('請求錯誤');
                 break;
         }
     } else {
         errMsg = 'Request Error';
     }
     return throwError(errResp.error as HttpError);
 }
開發者ID:yangjinguang,項目名稱:liyu,代碼行數:30,代碼來源:http-client.ts

示例4: Observable

        return new Observable((observer) => {
            if (this.userSrv.isLogin) {
                observer.next(true);
                observer.complete();
                return;
            }

            this.msg.error('請先登錄');
            observer.next(false);
            observer.complete();
        });
開發者ID:mohamedbadr,項目名稱:ng-alain,代碼行數:11,代碼來源:can-auth.provide.ts

示例5: Observable

        return new Observable((observer) => {
            if (this.userSrv.hasRole('admin')) {
                observer.next(true);
                observer.complete();
                return;
            }

            this.msg.error('授權不足');
            observer.next(false);
            observer.complete();
        });
開發者ID:mohamedbadr,項目名稱:ng-alain,代碼行數:11,代碼來源:can-admin.provide.ts

示例6: 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);
         });
     }
 });
開發者ID:yangjinguang,項目名稱:liyu,代碼行數:23,代碼來源:login.component.ts

示例7:

 .subscribe(result => this.msg.info(`subscribe sub status: ${JSON.stringify(result)}`));
開發者ID:duxie,項目名稱:ng-alain,代碼行數:1,代碼來源:custom.component.ts

示例8:

 onOk: () => {
     localStorage.clear();
     this.messageServ.success('Clear Finished!');
 }
開發者ID:staneee,項目名稱:ABPTemplateUI-ng-alain,代碼行數:4,代碼來源:storage.component.ts

示例9: copy

 copy(value).then(() => this.msg.success(this.i18n.fanyi('app.demo.copied')));
開發者ID:wexz,項目名稱:delon,代碼行數:1,代碼來源:footer.component.ts

示例10:

 _clear() {
     localStorage.clear();
     this.messageServ.success('清空完成!');
 }
開發者ID:ezhuo,項目名稱:angular-admin-ng-zorro,代碼行數:4,代碼來源:storage.component.ts


注:本文中的ng-zorro-antd.NzMessageService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。