本文整理汇总了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');
}
}
示例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
示例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);
}),
示例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');
}
}
示例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');
}
}
示例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
示例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 = '';
}
示例8: warning
warning(message: string): void {
this.toastr.warning(message);
}
示例9: warning
warning(text: string) {
this.toastr.warning(text);
}
示例10:
res => {
this.service.getLivrosCadastrados();
this.toastr.warning('OcorrĂŞncia removida com sucesso!', 'FormulĂĄrio');
},