Skip to content

Commit

Permalink
docs($cookies): added example to $cookies api docs
Browse files Browse the repository at this point in the history
Better than nothing.
  • Loading branch information
ProLoser authored and IgorMinar committed Jan 30, 2013
1 parent 17fc6a7 commit e0295cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ngCookies/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ angular.module('ngCookies', ['ng']).
* this object, new cookies are created/deleted at the end of current $eval.
*
* @example
<doc:example>
<doc:source>
<script>
function ExampleController($cookies) {
// Retrieving a cookie
var favoriteCookie = $cookies.myFavorite;
// Setting a cookie
$cookies.myFavorite = 'oatmeal';
}
</script>
</doc:source>
</doc:example>
*/
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
var cookies = {},
Expand Down

0 comments on commit e0295cf

Please sign in to comment.