urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

amMoment.changeLocale and ui-router #128

Open johannesjo opened 9 years ago

johannesjo commented 9 years ago

When using ui-router the locale is only loaded correctly on the first page. After triggering a route change it defaults back to the default browser language.

I worked around this by setting the local on $stateChangeStart

$rootScope.$on('$stateChangeStart', function (event, next) {
      amMoment.changeLocale('de');
});
corentin-gautier commented 9 years ago

I'm having the same issue, but this work around does not resolve it entirely for me ... any ideas on what causes it ?

urish commented 8 years ago

I still have no idea what could be causing this, have you found out why this happens?

Otherwise, I'd appreciate a short plunkr example demonstrating this issue so I could investigate it. Thanks!

rooswelt commented 8 years ago

For me problem seems related to another lib, angular-timer. Once removed it, problem disappeared.

Now I need to understand what's wrong with angular-timer, 'cause I need it!

rooswelt commented 8 years ago

Specifying "language" attribute for each <timer> in my code seems resolve problem,

Hope it helps