How to use toastr - 10 common examples

To help you get started, we’ve selected a few toastr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CSCfi / exam / app / frontend / src / exam / editor / sections / sectionQuestion.component.ts View on Github external
esq => {
                            toast.info(this.$translate.instant('sitnet_question_saved'));
                            // apply changes back to scope
                            ng.extend(this.sectionQuestion, esq);
                        });
github CSCfi / exam / app / frontend / src / review / questions / assessment / questionAssessment.component.ts View on Github external
}).catch(err => {
                    // Roll back
                    answer.essayAnswer.evaluatedScore = answer.essayAnswer.temporaryScore;
                    toast.error(err.data);
                    resolve();
                });
            });
github Lemoncode / react-typescript-samples / 15 Lazy Loading / src / components / member / memberPage.tsx View on Github external
componentWillReceiveProps(nextProps) {
   if(this.props.saveCompleted != nextProps.saveCompleted
      && nextProps.saveCompleted) {

      // Show toast
     toastr.success('Author saved.');

     // using hashHistory, TODO: proper configure browserHistory on app and here
     hashHistory.push('/members')

     // Reset saveCompleted flag
     this.props.resetSaveCompletedFlag();

   }
 }
github weseek / growi / src / client / js / util / apiNotification.js View on Github external
export const toastError = (err, header = 'Error', option = toastrOption.error) => {
  const errs = toArrayIfNot(err);

  for (const err of errs) {
    toastr.error(err.message, header, option);
  }
};
github teki-io / teki / client / src / client / app / shared / services / error-handler.ts View on Github external
handle(error:any) {
    if (error.status === 401) {
      this.translate.get('error.pleaseSignIn').subscribe((msg: string) => toastr.error(msg));
      this.auth.logout();
      this.router.navigate(['/Login']);
    }

    if (error.status === 422) {
      let msg:string = _.chain(error.json()).values().first().value();
      toastr.error(msg);
    }
    return Observable.throw('Server error');
  }
}
github weseek / growi / src / client / js / components / PageEditor.js View on Github external
apiErrorHandler(error) {
    toastr.error(error.message, 'Error occured', {
      closeButton: true,
      progressBar: true,
      newestOnTop: false,
      showDuration: '100',
      hideDuration: '100',
      timeOut: '3000',
    });
  }
github CSCfi / exam / app / frontend / src / session / session.service.ts View on Github external
private onLoginFailure(message: any): void {
        this.$location.path('/');
        toastr.error(message);
    }
github CSCfi / exam / app / frontend / src / exam / collaborative / collaborativeExamListing.component.ts View on Github external
this.CollaborativeExam.createExam().then((exam: CollaborativeExam) => {
                toast.info(this.$translate.instant('sitnet_exam_created'));
                this.$location.path(`/exams/collaborative/${exam.id}/1`);
            }).catch(resp => toast.error(resp.data));
        }
github CSCfi / exam / app / frontend / src / reservation / admin / changeMachineDialog.component.ts View on Github external
.then((resp: angular.IHttpResponse) => {
                    toast.info(this.$translate.instant('sitnet_updated'));
                    this.close(
                        {
                            $value: {
                                msg: 'Accepted',
                                machine: resp.data
                            }
                        });
                }).catch(resp => toast.error(resp.data));
        }

toastr

ToastrJS is a JavaScript library for Gnome / Growl type non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.

MIT
Latest version published 6 years ago

Package Health Score

40 / 100
Full package analysis

Popular toastr functions