Comments (5)
Have you added your domain to the NgcCookieConsentConfig object?
{
"cookie": {
"domain": "your domain here"
},
...
}
Also, remember to inject the NgcCookieConsentService in your AppComponent.
from ngx-cookieconsent.
Had same annoying issue.
Added below code in main component
this.statusChangeSubscription = this.ccService.statusChange$.subscribe(
(event: NgcStatusChangeEvent) => {
if (event.status === 'allow') {
this.cookieService.set(IS_COOKIE_ALLOWED, 'true');
this.ccService.destroy();
} else {
this.cookieService.delete(IS_COOKIE_ALLOWED);
}
});
let isCookieAllowed = this.cookieService.get(IS_COOKIE_ALLOWED);
if (isCookieAllowed == 'true') {
this.ccService.destroy();
}
Note:
there is cookieService
imported (ngx-cookie-service in our project)
there is const IS_COOKIE_ALLOWED: string
defined whenever you want (defined and exported in cookie.conf.ts
in our project)
from ngx-cookieconsent.
I have two domains rajeshyadav.net and rajeshkumaryadav.com in the domain I set .com site which works fine but when I open .net site I click got it and refresh page again it shows, can we pass two domains ?
from ngx-cookieconsent.
@rajeshyadavdotnet I think this answers your question #36 (comment) it's not a detailed answer, but should get you started.
from ngx-cookieconsent.
Thanks @fromm1990: your comments do indeed answer @chiraggmodi and @rajeshyadavdotnet's questions (which are unrelated by the way)
Closing for now
from ngx-cookieconsent.
Related Issues (20)
- [Bug] HOT 2
- [Bug] Angular 13 not supported HOT 1
- [Bug] SSR - Cookie popup has not yet been instantiated. Cannot invoke {{methodName}}
- [Bug] ccService.initializing, ccService.initialized and ccService.initializationError does not exist on NgcCookieConsentService HOT 2
- [Feature] Angular 14 HOT 22
- The automated release is failing 🚨
- [Bug] Wrong `peerDependencies` for rxjs for Angular v14+ HOT 3
- Does not save its own cookie on AWS amplify HOT 1
- Cookie popup not appearing in published website HOT 1
- [Bug] Restrictive `peerDependency` of `rxjs` causes conflicts with other packages
- [Bug] whitelistPage and blacklistPage options are not working well
- [Bug] Support for Angular 15 HOT 1
- The automated release is failing 🚨
- [Bug] Needs to be Ivy compliant [Angular 16] HOT 18
- How do I opt-in a session when cookie consent is not required?
- Cookie-banner disabled by AdBlocker[Bug] HOT 1
- [chore] Update to latest Nx version
- [chore] Setup Nx Dependency Check ESLint
- [Feature] Add mobileForceFloat option HOT 1
- How to set consent? How to prevent popup opening after setting cookie? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-cookieconsent.