NGX Cookie Service in angular
Angular service to read, set and delete browser cookies. Originally based on the ng2-cookies library. The experienced team behind Studytube will take care of our cookie service from now on.
1. install
npm install ngx-cookie-service --save
2. in app.modules.ts
import {CookieService} from 'ngx-cookie-service';
providers: [
CookieService
],
3. in component
import {CookieService} from 'ngx-cookie-service';
export class myComponent {
constructor(private cookieService: CookieService) { }
ngOnInit(){
console.log("fav clicked");
console.log(this.cookieService.getAll());
}
}
Documentation:
https://github.com/stevermeister/ngx-cookie-service