June 2014
Intermediate to advanced
696 pages
38h 52m
English
AngularJS provides a couple services for getting and setting cookies: $cookie and $cookieStore. Cookies provide temporary storage in a browser and persist even when the user leaves the webpage or closes the browser.
The $cookie service allows you to get and change string cookie values by using dot notation. For example, the following retrieves the value of a cookie with the name appCookie and then changes it:
var cookie = $cookies.appCookie;$cookies.appCookie = 'New Value';
The $cookieStore service provides get(), put(), and remove() functions to get, set, and remove cookies. A nice feature of the $cookieStore service is that it serializes JavaScript ...
Read now
Unlock full access