import { Component , OnInit } from '@angular/core' ; import { MatomoTracker } from 'ngx-matomo' ; @ Component ( { selector : 'app-consent' , templateUrl : './consent.component.html' , styleUrls : [ ] , } ) export class ConsentComponent implements OnInit { param matomoTracker param formBuilder constructor ( private readonly matomoTracker ) { } /**
     * Angular OnInit lifecycle hook.
     */ ngOnInit ( ) { this . matomoTracker . hasCookies ( ) . then ( ( hasCookies ) => console . log ( 'Has Cookies:' , hasCookies ) ) ; } onGiveConsent ( event ) { this . matomoTracker . setConsentGiven ( ) ; this . matomoTracker . hasCookies ( ) . then ( ( hasCookies ) => console . log ( 'Has Cookies:' , hasCookies ) ) ; } onRemoveConsent ( event ) { this . matomoTracker . forgetConsentGiven ( ) ; this . matomoTracker . hasCookies ( ) . then ( ( hasCookies ) => console . log ( 'Has Cookies:' , hasCookies ) ) ; } }