Angularjs ngx toastr全局配置超时设置
无法使用IndividualConfig和GlobalConfig类实现Angularjs ngx toastr全局配置超时设置,angularjs,typescript,toastr,angular-toastr,Angularjs,Typescript,Toastr,Angular Toastr,无法使用IndividualConfig和GlobalConfig类实现 imports: [ToastrModule.forRoot({timeOut: 10000, positionClass: 'toast-bottom-right', preventDuplicates: true})] 像上面的代码片段那样设置GlobalConfig将为所有类型的messages/toastrs设置超时,我想控制每种类型的message的超时。例如,我想在2000毫秒后超时成功消息,6秒后超时错误消
imports: [ToastrModule.forRoot({timeOut: 10000, positionClass: 'toast-bottom-right', preventDuplicates: true})]
像上面的代码片段那样设置GlobalConfig将为所有类型的messages/toastrs设置超时,我想控制每种类型的message的超时。例如,我想在2000毫秒后超时成功消息,6秒后超时错误消息,3秒后超时警告和信息。我在咆哮消息中看到这种配置,但不确定ngx toastr消息
我曾尝试在angular 1.x版本应用程序中使用咆哮消息
growlProvider.globalTimeToLive({成功:2000,错误:5000,警告:3000,信息:2000});growlProvider.globalDisableCountDown(真)代码>
在Angular 6应用程序中
imports:[ToastrModule.forRoot({timeOut:10000})]
我可以设置全局超时,这将应用于所有消息通知,但我想控制每种消息类型我认为这个答案将帮助您。他们建议编写一个类,允许对每种吐司类型进行“全局”设置