©
本文档使用
php.cn手册 发布
ngCookies
The ngCookies
module provides a convenient wrapper for reading and writing browser cookies.
参见 $cookies
and
$cookieStore
for usage.
First include angular-cookies.js
in your HTML:
1 2 |
|
You can download this file from the following places:
//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-cookies.js
1 |
|
1 |
|
where X.Y.Z is the AngularJS version you are running.
Then load the module in your application by adding it as a dependent module:
1 |
|
With that you're ready to get started!
名称 | 描述 |
---|---|
$cookies |
Provides read/write access to browser's cookies. |
$cookieStore |
Provides a key-value (string-object) storage, that is backed by session cookies. Objects put or retrieved from this storage are automatically serialized or deserialized by angular's toJson/fromJson. |