From e85774f709b9f681b0ff8d829b07568b0f844a62 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 19 Jul 2012 01:10:12 -0700 Subject: fix(ngPluralize): fixes ng-pluralize when using non-standard start/end symbols Closes #1134 --- src/ng/directive/ngPluralize.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ng/directive/ngPluralize.js b/src/ng/directive/ngPluralize.js index a3424cf5..d9327b82 100644 --- a/src/ng/directive/ngPluralize.js +++ b/src/ng/directive/ngPluralize.js @@ -178,11 +178,14 @@ var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interp whenExp = element.attr(attr.$attr.when), // this is because we have {{}} in attrs offset = attr.offset || 0, whens = scope.$eval(whenExp), - whensExpFns = {}; + whensExpFns = {}, + startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(); forEach(whens, function(expression, key) { whensExpFns[key] = - $interpolate(expression.replace(BRACE, '{{' + numberExp + '-' + offset + '}}')); + $interpolate(expression.replace(BRACE, startSymbol + numberExp + '-' + + offset + endSymbol)); }); scope.$watch(function() { -- cgit v1.2.3