diff --git a/src/ngCookies/cookies.js b/src/ngCookies/cookies.js index 6e3f3abc..63289269 100644 --- a/src/ngCookies/cookies.js +++ b/src/ngCookies/cookies.js @@ -34,12 +34,13 @@ angular.module('ngCookies', ['ng']). * @example * * ```js - * function ExampleController($cookies) { - * // Retrieving a cookie - * var favoriteCookie = $cookies.myFavorite; - * // Setting a cookie - * $cookies.myFavorite = 'oatmeal'; - * } + * angular.module('cookiesExample', ['ngCookies']) + * .controller('ExampleController', ['$cookies', function($cookies) { + * // Retrieving a cookie + * var favoriteCookie = $cookies.myFavorite; + * // Setting a cookie + * $cookies.myFavorite = 'oatmeal'; + * }]); * ``` */ factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) { @@ -137,14 +138,15 @@ angular.module('ngCookies', ['ng']). * @example * * ```js - * function ExampleController($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * } + * angular.module('cookieStoreExample', ['ngCookies']) + * .controller('ExampleController', ['$cookieStore', function($cookieStore) { + * // Put cookie + * $cookieStore.put('myFavorite','oatmeal'); + * // Get cookie + * var favoriteCookie = $cookieStore.get('myFavorite'); + * // Removing a cookie + * $cookieStore.remove('myFavorite'); + * }]); * ``` */ factory('$cookieStore', ['$cookies', function($cookies) {