aurelia-cookie
A simplistic ES2015 class for working with cookies in Aurelia (or any modern Javascript application).
Installation
Jspm
jspm install npm:aurelia-cookie
Aurelia CLI/Webpack
npm install aurelia-cookie
CLI User?
The Aurelia CLI requires some additional configuration to use this plugin. Open up your aurelia.json
file located in the aurelia_project
directory and at the bottom of the dependencies
section add in the following:
{
"name": "aurelia-cookie",
"path": "../node_modules/aurelia-cookie/dist/amd",
"main": "index"
}
Setup
Just like you would any other plugin, simply instantiate it with the framework inside of your main bootstrapping file.
aureliause;
Use
;// Set a cookieCookie;Cookie; // Get a cookie valueCookie; // Delete a cookie by nameCookieall; // Returns an array of all set cookies