π
@wecodeit/ng-cookie-consent
Easy way to get and manage users CookieConsent in Angular. It automatically checks for an existing consent cookie - if it exists, no cookie banner will be shown. Otherwise the basic banner will be displayed and the users input will be stored in firestore.
β¨ Demo
Install
npm i --save @wecodeit/ng-cookie-consent
Usage
Import the CookieConsent Module into your app.module.ts and initialize it with your firebase configuration.
import {CookieConsentModule} from '@wecodeit/ng-cookie-consent';
@NgModule({
imports: [
CookieConsentModule.forRoot(environment.firebase)
]
})
export class AppModule { }
If you want to use your own configuration, you can use the COOKIE_CONSENT_CONFIG
InjectionToken:
import {COOKIE_CONSENT_CONFIG, CookieConsentConfig} from '@wecodeit/ng-cookie-consent';
const cookieConfig: CookieConsentConfig = {
bannerConfig: {
htmlHeader: '<b>Just a test</b>'
}
}
@NgModule({
providers: [
{ provide: COOKIE_CONSENT_CONFIG, useValue: cookieConfig }
]
})
export class AppModule { }
Author
- Website: www.wecodeit.dev
- Github: @felixjiricka
This README was generated with