Reputation: 4374
I'm tring to store logged in user information in Angular Cookies. Strangely it work's well in browser when I do ionic serve
. Also works in phone debug mode using ionic run android -l-c --debug
usb debugging mode. But when I do ionic build android
user information does not get stored in the $cookiestore.
I have referenced <script src="lib/angular-cookies/angular-cookies.min.js"></script>
in my index.html
Upvotes: 0
Views: 388
Reputation: 66
Simply replace $cookieStore
with localStorage
. It plays nice with both Android and iPhone. :)
$cookieStore.set() -> window.localStorage.setItem()
$cookieStore.get() -> window.localStorage.getItem()
$cookieStore.remove() -> window.localStorage.removeItem()
Upvotes: 1