当前位置: 首页>>代码示例>>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;未经允许,请勿转载。