docs($cookies): added example to $cookies api docs

Better than nothing.
This commit is contained in:
Dean Sofer 2013-01-25 02:24:50 -08:00 committed by Igor Minar
parent 559d5efc04
commit 971d97e2ec

View file

@ -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 = {},