urish / angular-moment

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

Calling changeLocale doesn't work with amFromUnix filter #297

Open magicznyleszek opened 6 years ago

magicznyleszek commented 6 years ago

I'm using latest 1.0.1 version.

This is my karma test scenario:

amMoment.changeLocale('en-US');
el = angular.element('<span am-time-ago="\'1095379200\' | amFromUnix"></span>');
el = $compile(el)($rootScope);
$rootScope.$digest();
expect(el.text()).toBe('13 years ago');

amMoment.changeLocale('pl-PL');
expect(el.text()).toBe('13 lat temu');

The first expect passes, but second one doesn't: Expected '13 years ago' to be '13 lat temu'.