mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 07:14:44 +00:00
docs($cookies): added example to $cookies api docs
Better than nothing.
This commit is contained in:
parent
559d5efc04
commit
971d97e2ec
1 changed files with 12 additions and 0 deletions
|
|
@ -19,6 +19,18 @@ angular.module('ngCookies', ['ng']).
|
||||||
* this object, new cookies are created/deleted at the end of current $eval.
|
* this object, new cookies are created/deleted at the end of current $eval.
|
||||||
*
|
*
|
||||||
* @example
|
* @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) {
|
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
|
||||||
var cookies = {},
|
var cookies = {},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue