angular js - ngCookie
Warning: if you need to set cookie expiration, httpSecure, path or subdomain then ngCookies doesn't support as of v1.2.7. I plan to use jquery-cookie.js which angular issues also reference, and there is a number of issues open related to this gap in $cookies. Angular js provides support for cookie manipulation in the core library file angular-cookies.js (v1.2.7). That file defines a module ngCookies with 2 factory services: - $cookies - $cookieStore For setting of a simple property on a cookie then $cookies is the factory to use. For setting js objects (key-value pairs) in the cookie then $cookieStore is what to use. To use: 1. include the angular-cookies.js file in yout html 2. include the module ngCookies as a module dependency where you wish to use 3. request $cookies or $cookieStore (or both) to be injected by the dependency injector Using $cookie. With $cookie you can treat a cookie name as a property on $cookie. var cookieValue = $cookies.coo...