Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs ngx toastr全局配置超时设置_Angularjs_Typescript_Toastr_Angular Toastr - Fatal编程技术网

Angularjs ngx toastr全局配置超时设置

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秒后超时错误消

无法使用IndividualConfig和GlobalConfig类实现

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})]

我可以设置全局超时,这将应用于所有消息通知,但我想控制每种消息类型

我认为这个答案将帮助您。他们建议编写一个类,允许对每种吐司类型进行“全局”设置