【发布时间】:2023-04-07 20:40:02
【问题描述】:
我已经从 nuget 下载了 angular-toaster.d.ts 文件并实现了一个通知服务,没有错误,但它不工作
export class notificationService {
constructor(private toaster: ngtoaster.IToasterService) {
debugger;
// this.toaster.toast.timeout = 3000;
// this.toaster.toast.type = EnergyTechApp.Entity.Constants.info;
// this.toaster.toast.showCloseButton = true;
}
displaySuccess(message: string) {
debugger;
this.toaster.success(message); /// not working Not displaying anything
this.toaster.success("", "", 122, ""); // this is a overload
}
}
我不完全知道要在超载中发送什么,d.ts 文件中的超载是
success(title?:string,
body?:string,
timeout?:number,
bodyOutputType?:string,
clickHandler?:EventListener,
toasterId?:number): void
什么是 eventHandler 以及我必须通过什么才能使烤面包机工作?
【问题讨论】:
-
吐司来了吗?是否有任何控制台错误
-
toast 没有出现,甚至控制台中也没有错误。 :-(
标签: javascript angularjs typescript typescript1.5