import { Injectable, Injector } from '@angular/core'; import { AppLocalizationService } from '@app/shared/common/localization/app-localization.service'; import { AppComponentBase } from '@shared/common/app-component-base'; import { Router, ActivatedRoute } from '@angular/router'; import {Observable} from 'rxjs'; import {map} from 'rxjs/operators'; @Injectable() export class CookieConsentService extends AppComponentBase{ constructor( private _appLocalizationService: AppLocalizationService, private router: Router, injector: Injector, private route: ActivatedRoute ) { super(injector); } public init() { if (abp.setting.getBoolean('App.UserManagement.IsCookieConsentEnabled')) { var path = window.location.pathname; console.log(path); (window as any).cookieconsent.initialise({ 'showLink': true, // "type": "opt-in", 'content': { 'message': this._appLocalizationService.l('CookieConsent_Message'), "dismiss": "Allow Cookies", "link": "Learn more", 'href': "/account/cookies-content", "target": "_self", }, blacklistPage: ['/account/cookies-content'], "palette": { popup: {background: '#ffb822'}, button:this.appSession.tenancyName == 'Antech'? {background: '#17a2b8'} :{background: '#476b2d'} // {background: '#3085d6'}this.appSession.Te }, onStatusChange: function(status) { console.log(this.hasConsented() ? 'enable cookies' : 'disable cookies'); } }); } } }