如何删除小的"Cookie策略“窗口?我使用的是Angular 7.2的最新版本的ngx- latest

发布于 2020-07-29 02:00:56
我被迫关闭了它:
this.ccService.close(false);
或者通过this.ccService.fadeOut();隐藏
因为'revokable': false选项不起作用。
发布于 2019-04-18 21:32:13
你试过this.ccService.getConfig().autoOpen=false吗?保存cookie后,我将其设置为false。
发布于 2021-03-02 21:04:38
我回答这个问题有点晚了,但今天遇到了同样的问题,我找到了一些解决方法。
this.statusChangeSubscription = this.ccService.statusChange$.subscribe(
(event: NgcStatusChangeEvent) => {
if (event.status === 'allow') {
this.ccService.close(false); // Hide revoke button after accepting cookies
}
});在下面或在ngOnInit()的末尾,我添加了以下内容:
if (this.ccService.hasConsented()) {
this.ccService.destroy();
}上面的代码检查你是否得到了同意,如果是,它将销毁弹出实例。
https://stackoverflow.com/questions/54902576
复制相似问题