diff --git a/modules/@angular/platform-browser/src/animate/animation.ts b/modules/@angular/platform-browser/src/animate/animation.ts index f5f5ec82a5..dc2ef2713f 100644 --- a/modules/@angular/platform-browser/src/animate/animation.ts +++ b/modules/@angular/platform-browser/src/animate/animation.ts @@ -184,6 +184,7 @@ export class Animation { let value = NumberWrapper.parseInt(this.stripLetters(duration), 10); if (value > maxValue) maxValue = value; } else if (duration.substring(duration.length - 1) == 's') { + duration = StringWrapper.replace(duration, ',', '.'); let ms = NumberWrapper.parseFloat(this.stripLetters(duration)) * 1000; let value = Math.floor(ms); if (value > maxValue) maxValue = value; diff --git a/modules/@angular/platform-browser/test/animate/animation_builder_spec.ts b/modules/@angular/platform-browser/test/animate/animation_builder_spec.ts index c48c0236ad..9bda4ef1f9 100644 --- a/modules/@angular/platform-browser/test/animate/animation_builder_spec.ts +++ b/modules/@angular/platform-browser/test/animate/animation_builder_spec.ts @@ -93,6 +93,15 @@ export function main() { } })); + it('should support parsing when commas are used as decimal separator due to regional settings', + inject([AnimationBuilder], (animate) => { + var animateCss = animate.css(); + var element = el(`
`); + var runner = animateCss.start(element); + expect(runner.parseDurationString('0,5s')).toBe(500); + expect(runner.parseDurationString('0.5s')).toBe(500); + })); + it('should add classes', inject([AnimationBuilder], (animate) => { var animateCss = animate.css().addClass('one').addClass('two'); var element = el('
');