lgalfaso / angular-dynamic-locale

Module to be able to change the locale at an angularjs application
http://lgalfaso.github.io/angular-dynamic-locale/
MIT License
322 stars 75 forks source link

Angularjs 1.7.x $cookieStore removed #121

Closed f-aubert closed 6 years ago

f-aubert commented 6 years ago

Hello, maybe I'm wrong but service $cookieStore seems to have been removed. Is there any chance it to be replaced with service $cookies (see https://docs.angularjs.org/guide/migration#migrating-from-1-6-to-1-7) as I presently cannot upgrade to angular 1.7.x long term support and use angular-dynamic-locale.

lgalfaso commented 6 years ago

Hi, as a quick fix, you should be able to do

angular.module(..., ['tmh.dynamicLocale', ...])
  .config(function(tmhDynamicLocaleProvider) {
    tmhDynamicLocaleProvider.useStorage('$cookies');
  })

This has the issue that $cookieStore uses get/put to store things in JSON and $cookies uses the same methods to store things as string. This is, there is no easy way to migrate.

I should be able to have a permanent fix within a few days.

lgalfaso commented 6 years ago

Version 0.1.36 should work as expected with Angular 1.7+.

Please let me know if you find any issues.

f-aubert commented 6 years ago

As far as I tested so far, it works great! It compiles and it runs. Thanks a lot for such a quick fix! You're amazing.