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


TypeScript ToastrService.warning方法代碼示例

本文整理匯總了TypeScript中ngx-toastr.ToastrService.warning方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastrService.warning方法的具體用法?TypeScript ToastrService.warning怎麽用?TypeScript ToastrService.warning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ngx-toastr.ToastrService的用法示例。


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

示例1: onRecordChange

 onRecordChange(record: object) {
   // update record if the edited one is not revision.
   if (!this.revision) {
     this.record = record;
   } else {
     this.toastrService.warning('You are changing the revisions and your changes will be lost!', 'Warning');
   }
 }
開發者ID:harunurhan,項目名稱:record-editor,代碼行數:8,代碼來源:json-editor-wrapper.component.ts

示例2: signupFunction

  public signupFunction(): any {

    if (!this.firstName) {
      this.toastr.warning("First Name is required", "Warning!");
    }
    else if (!this.lastName) {
      this.toastr.warning("Last Name is required", "Warning!");
    }
    else if (!this.mobileNumber) {
      this.toastr.warning("Mobile Number is required", "Warning!");
    }
    else if (!this.email) {
      this.toastr.warning("Email is required", "Warning!");
    }
    else if (!this.password) {
      this.toastr.warning("Password is required", "Warning!");
    }
    else {

      let data = {
        firstName: this.firstName,
        lastName: this.lastName,
        mobileNumber: this.mobileNumber,
        email: this.email,
        password: this.password
      }

      this.appService.signUpFunction(data)
        .subscribe((apiResponse) => {

          if (apiResponse.status == 200) {
            this.toastr.success("Signed Up", "!SuccesFull");
            setTimeout(() => {
              this.goToSignIn();
            }, 2000);//redirecting to signIn page

          }
          else {
            this.toastr.error(apiResponse.message, "Error!");
          }
        },
          (error) => {
            this.toastr.error("Some Error Occurred", "Error!");
          });//end calling signUpFunction
    }
  }//end signUp function
開發者ID:HanumantChidrawar,項目名稱:groupChatAppFrontEnd,代碼行數:46,代碼來源:signup.component.ts

示例3: catchError

 catchError((error: ApiResponse) => {
     if (error.message.length > 0 && error.message.match(/storage/i)) {
         this.notify.warning('Storage "' + payload + '" was not found.');
         ctx.dispatch(new Navigate(['/admin/storages']));
     } else {
         this.notify.error('Could not retrieve repositories ' + payload + '!');
         console.error('Could not retrieve repositories  for storage ' + payload + '!', error);
     }
     return of(error);
 }),
開發者ID:strongbox,項目名稱:strongbox-web-ui,代碼行數:10,代碼來源:browse-storages.state.model.ts

示例4: onWorkflowMetadataChange

 onWorkflowMetadataChange(metadata: object) {
   if (!this.revision) {
     const workflowObject = Object.assign({}, this.workflowObject, { metadata });
     this.globalAppStateService
       .jsonBeingEdited$.next(workflowObject);
     this.globalAppStateService
       .isJsonUpdated$.next(true);
   } else {
     this.toastrService.warning('You are changing the revision and your changes will be lost!', 'Warning');
   }
 }
開發者ID:inspirehep,項目名稱:record-editor,代碼行數:11,代碼來源:holdingpen-editor.component.ts

示例5: onRecordChange

 onRecordChange(record: object) {
   // update record if the edited one is not revision.
   if (!this.revision) {
     this.globalAppStateService
       .jsonBeingEdited$.next(record);
     this.globalAppStateService
       .isJsonUpdated$.next(true);
   } else {
     this.toastrService.warning('You are changing the revision and your changes will be lost!', 'Warning');
   }
 }
開發者ID:inspirehep,項目名稱:record-editor,代碼行數:11,代碼來源:json-editor-wrapper.component.ts

示例6: signInFunction

  public signInFunction(): any {
    let data: any = {
      email: this.email,
      password: this.password
    }

    if (!this.email) {
      this.toastr.warning("Email is required", "Warning");
    }
    else if (!this.password) {
      this.toastr.warning("Password is required", "Warning");
    }
    else {
      this.appService.signInFunction(data)
        .subscribe((apiResponse) => {

          if (apiResponse.status == 200) {
            this.toastr.success("Signed In", "Success");
            console.log(apiResponse);

            Cookie.set('authToken', apiResponse.data.authToken);
            Cookie.set('receiverId', apiResponse.data.userDetails.userId);
            Cookie.set('receiverName', `${apiResponse.data.userDetails.firstName} ${apiResponse.data.userDetails.lastName}`);
            this.appService.setUserInfoInLocalStorage(apiResponse.data.userDetails);

            setTimeout(() => {
              this.router.navigate(['/chat']);
            }, 2000);
          }
          else {
            this.toastr.error(apiResponse.message);
          }
        },
          (error) => {
            this.toastr.error("Some error occured");
          });
    }
  }//end of signIn function
開發者ID:HanumantChidrawar,項目名稱:groupChatAppFrontEnd,代碼行數:38,代碼來源:login.component.ts

示例7: showSavedMessage

  showSavedMessage() {
    if (this._savedSeverity === '' || this._savedMessage === '') {
      return;
    }

    if (this._savedSeverity === 'error') {
      this._toastr.error(this._savedMessage);
    } else if (this._savedSeverity === 'warning') {
      this._toastr.warning(this._savedMessage);
    } else if (this._savedSeverity === 'info') {
      this._toastr.info(this._savedMessage);
    } else if (this._savedSeverity === 'success') {
      this._toastr.success(this._savedMessage);
    }

    this._savedSeverity = '';
    this._savedMessage = '';
  }
開發者ID:epot,項目名稱:Gifter,代碼行數:18,代碼來源:error-handle.service.ts

示例8: warning

 warning(message: string): void {
   this.toastr.warning(message);
 }
開發者ID:peasy,項目名稱:peasy-js-samples,代碼行數:3,代碼來源:notification-messenger.ts

示例9: warning

 warning(text: string) {
   this.toastr.warning(text);
 }
開發者ID:demoiselle,項目名稱:generator-demoiselle,代碼行數:3,代碼來源:notification.service.ts

示例10:

 res => {
   this.service.getLivrosCadastrados();
   this.toastr.warning('OcorrĂŞncia removida com sucesso!', 'FormulĂĄrio');
 },
開發者ID:jMateusc,項目名稱:livroAPI,代碼行數:4,代碼來源:cadastro-listagem.component.ts


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