目前正在使用angulajs应用程序。
Currently am using angulajs app.
我想一些值存储在cookie中。所以我用角饼干分钟
脚本完成某些值添加到饼干
I want to store some values in cookie. So i used angular-cookies-min
script for add some values to cookies
我用低于code本作的值保存到cookie中。
I have used this below code for save values to cookie.
$cookieStore.put("userInfo", userInfo);//userInfo is a array with some values.
现在我要清除的饼干吗?我该怎么办呢?
试试这个code为删除Cookie
Try this code for delete cookie
$cookieStore.remove("userInfo");
修改:由于V1.4 $的CookieStore
已去precated(见的文档),因此从该版本的你应该使用:
EDIT: Since v1.4 $cookieStore
has been deprecated (see docs), so from that version on you should use:
$cookies.remove("userInfo");