Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-cookie-service

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-cookie-service

Angular cookie service

  • 17.0.0-next.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
398K
increased by3.93%
Maintainers
2
Weekly downloads
 
Created

What is ngx-cookie-service?

The ngx-cookie-service is an Angular service for handling cookies. It provides a simple API to set, get, and delete cookies in an Angular application.

What are ngx-cookie-service's main functionalities?

Set a Cookie

This feature allows you to set a cookie with a specified name and value. In this example, a cookie named 'test' with the value 'Hello World' is set.

import { CookieService } from 'ngx-cookie-service';

constructor(private cookieService: CookieService) { }

this.cookieService.set('test', 'Hello World');

Get a Cookie

This feature allows you to retrieve the value of a cookie by its name. In this example, the value of the cookie named 'test' is retrieved and logged to the console.

import { CookieService } from 'ngx-cookie-service';

constructor(private cookieService: CookieService) { }

const value = this.cookieService.get('test');
console.log(value);

Delete a Cookie

This feature allows you to delete a cookie by its name. In this example, the cookie named 'test' is deleted.

import { CookieService } from 'ngx-cookie-service';

constructor(private cookieService: CookieService) { }

this.cookieService.delete('test');

Check if a Cookie Exists

This feature allows you to check if a cookie exists by its name. In this example, it checks if the cookie named 'test' exists and logs the result to the console.

import { CookieService } from 'ngx-cookie-service';

constructor(private cookieService: CookieService) { }

const exists = this.cookieService.check('test');
console.log(exists);

Other packages similar to ngx-cookie-service

Keywords

FAQs

Package last updated on 13 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc