Angular.js: $cookies and $cookieStore needs documentation and example

Created on 30 Aug 2012  Â·  17Comments  Â·  Source: angular/angular.js

I can't find any official example whatsoever on cookie storage. $cookies also lacks API documentation.

PRs plz! docs

Most helpful comment

You can check out my repo here for a working example if that helps at all...

All 17 comments

What about this? http://docs.angularjs.org/api/ngCookies.$cookieStore

I see what you mean though, there are no usage examples...

I can't say there's any use to it until there is one.

+1 for Usage and examples.

Agree with @symblify and @gotoAndBliss.

+1 for Usage/Examples.

I completely agree.

+1

Is it right that $cookies is an abstraction of $cookieStore ? (like $resource is for $http)

I have 2 Examples

  1. with $cookieStore: http://jsfiddle.net/9jXF7/
  2. with $cookies: http://jsfiddle.net/5yFN5/

@ThomasDeutsch $cookies can not store objects as a value so if you need to add/read an object to/from cookie you must convert it to/from JSON string. That's what $cookieStore.put() and $cookieStore.get() methods for. $cookies itself adds and deletes cookies on $digest

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

lazy close!

@joseym would you like to submit a PR adding docs for this feature?

Sure

Sent from my iPhone

On Sep 5, 2013, at 12:54 PM, Brian Ford [email protected] wrote:

@joseym would you like to submit a PR adding docs for this feature?

—
Reply to this email directly or view it on GitHub.

+1 for example and usage

+1 for example and usage

We will definitely merge a PR that contains runnable examples. In the meantime there are indeed basic usage examples at

https://docs.angularjs.org/api/ngCookies/service/$cookies#example
and
https://docs.angularjs.org/api/ngCookies/service/$cookieStore#example

+1 for example and usage

You can check out my repo here for a working example if that helps at all...

Was this page helpful?
0 / 5 - 0 ratings