Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e0295cf

Browse files
ProLoserIgorMinar
authored andcommitted
docs($cookies): added example to $cookies api docs
Better than nothing.
1 parent 17fc6a7 commit e0295cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ngCookies/cookies.js

+12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ angular.module('ngCookies', ['ng']).
1919
* this object, new cookies are created/deleted at the end of current $eval.
2020
*
2121
* @example
22+
<doc:example>
23+
<doc:source>
24+
<script>
25+
function ExampleController($cookies) {
26+
// Retrieving a cookie
27+
var favoriteCookie = $cookies.myFavorite;
28+
// Setting a cookie
29+
$cookies.myFavorite = 'oatmeal';
30+
}
31+
</script>
32+
</doc:source>
33+
</doc:example>
2234
*/
2335
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
2436
var cookies = {},

0 commit comments

Comments
 (0)