Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Setting non-string values to Cookies #1311

Open
rkirov opened this issue Aug 5, 2014 · 1 comment
Open

Setting non-string values to Cookies #1311

rkirov opened this issue Aug 5, 2014 · 1 comment
Assignees
Milestone

Comments

@rkirov
Copy link
Contributor

rkirov commented Aug 5, 2014

Currently, setting non-string values to Cookies like cookies['a'] = 3 silently steps over due to:
https://github.com/angular/angular.dart/blob/b43de31d2a9f1c0274f659ada77714e63a6d0c6a/lib/core_dom/cookies.dart#L78

This has already confused somebody:
http://stackoverflow.com/questions/23051222/how-to-use-cookies-in-angulardart

We should either take any value and call toString() or annotate the appropriate methods with String so static type checking catches this.

@vicb
Copy link
Contributor

vicb commented Aug 5, 2014

👍 to add a String type and throw if not String.

It don't think it would make sense to add support for num (same for List, Map & user defined objects) because you'll always get a String back. To support this usages the users should use a (de)serialization library.

@rkirov rkirov self-assigned this Oct 2, 2014
@rkirov rkirov added this to the post v1.0 milestone Oct 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants