本文整理匯總了TypeScript中ng2-toastr.ToastsManager.success方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastsManager.success方法的具體用法?TypeScript ToastsManager.success怎麽用?TypeScript ToastsManager.success使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-toastr.ToastsManager
的用法示例。
在下文中一共展示了ToastsManager.success方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: onClick
@HostListener('click')
onClick() {
try {
// Create the input to hold our text.
const tmpInputElement = document.createElement('input');
tmpInputElement.value = this.getInputElement().value;
document.body.appendChild(tmpInputElement);
// Copy text to clipboard.
tmpInputElement.select();
document.execCommand('copy');
// Finally remove the element.
document.body.removeChild(tmpInputElement);
this.toastr.success('Copied text to the clipboard successfully.');
} catch (err) {
this.toastr.error('Failed to copy text to the clipboard.');
}
}
示例2: toastJobResult
/*
* Displays a message about a job
*/
toastJobResult(success: boolean, job: string, link?: string, id?: string)
{
let message: string;
if(success)
{
this.translateService.get('TOASTR.JOB.SUCCESS').subscribe(
value => {
message = value;
});
message += job;
if(link && id == undefined)
{
this.translateService.get('TOASTR.JOB.NAVIGATE').subscribe(
value => {
message += value;
});
this.toastr.onClickToast()
.subscribe( toast => {
this.router.navigate([link]);
});
}
if(link && id)
{
this.translateService.get('TOASTR.JOB.NAVIGATE').subscribe(
value => {
message += value;
});
this.toastr.onClickToast()
.subscribe( toast => {
this.router.navigate([link, {id: id}]);
});
}
this.toastr.success(message, '',{enableHTML: true});
}
else
{
this.translateService.get('TOASTR.JOB.FAIL').subscribe(
value => {
message = value;
});
this.toastr.error(message + job);
}
}
示例3:
(response) => {
this.getParamedics();
this._toast.success(`Se elimino el paramedico`, 'Paramedicos!');
},
示例4:
this._feedbackService.leftFeedback(this.feedbackForm.value).subscribe(() => {
this._toastr.success('Отзыв успешно отправлен', 'Успешно!');
this._router.navigateByUrl('/');
}, error => {
示例5:
(response) => {
this.getEmergencies();
this._toast.success(`Se elimino la emergencia`, 'Emergencias!');
},
示例6:
(response) => {
this.getAmbulances();
this._toast.success(`Se elimino la ambulancia `, 'Emergencias!');
},
示例7:
(res) => {
this._toast.success(`Se registro el paramedico ${res.json().name}`, 'Paramedicos!');
this.formParamedics.reset({
gender: ''
})
},