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

angular-cookies

Package Overview
Dependencies
Maintainers
3
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-cookies

AngularJS module for cookies

  • 1.8.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
92K
decreased by-18.91%
Maintainers
3
Weekly downloads
 
Created

What is angular-cookies?

The angular-cookies npm package provides a convenient way to read, write, and delete browser cookies in AngularJS applications. It simplifies cookie management by offering a set of services that can be easily integrated into AngularJS components.

What are angular-cookies's main functionalities?

Setting a Cookie

This feature allows you to set a cookie with a specified key and value. In this example, a cookie named 'myFavorite' is set with the value 'oatmeal'.

angular.module('myApp', ['ngCookies'])
  .controller('CookieController', ['$cookies', function($cookies) {
    $cookies.put('myFavorite', 'oatmeal');
  }]);

Getting a Cookie

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

angular.module('myApp', ['ngCookies'])
  .controller('CookieController', ['$cookies', function($cookies) {
    var favoriteCookie = $cookies.get('myFavorite');
    console.log(favoriteCookie); // Outputs: oatmeal
  }]);

Removing a Cookie

This feature allows you to remove a cookie by its key. In this example, the 'myFavorite' cookie is removed.

angular.module('myApp', ['ngCookies'])
  .controller('CookieController', ['$cookies', function($cookies) {
    $cookies.remove('myFavorite');
  }]);

Other packages similar to angular-cookies

Keywords

FAQs

Package last updated on 05 Oct 2020

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