From 7a543c985e3d0cd028e49948fe496800f900ae96 Mon Sep 17 00:00:00 2001 From: eydreeyawn Date: Mon, 28 Apr 2014 17:12:26 +0800 Subject: [PATCH] docs(ngCookies): added example usage of cookieStore Closes #7278 --- src/ngCookies/cookies.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ngCookies/cookies.js b/src/ngCookies/cookies.js index 0d05fb19eaa5..548ca04b80d0 100644 --- a/src/ngCookies/cookies.js +++ b/src/ngCookies/cookies.js @@ -133,6 +133,19 @@ angular.module('ngCookies', ['ng']). * deserialized by angular's toJson/fromJson. * * Requires the {@link ngCookies `ngCookies`} module to be installed. + * + * @example + * + * ```js + * function ExampleController($cookies) { + * // Put cookie + * $cookieStore.put('myFavorite','oatmeal'); + * // Get cookie + * var favoriteCookie = $cookieStore.get('myFavorite'); + * // Removing a cookie + * $cookieStore.remove('myFavorite'); + * } + * ``` */ factory('$cookieStore', ['$cookies', function($cookies) {