本文整理匯總了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');
},