Skip to content

Commit

Permalink
fix(ngPluralize): fixes ng-pluralize when using non-standard start/en…
Browse files Browse the repository at this point in the history
…d symbols

Closes angular#1134
  • Loading branch information
btford committed Aug 8, 2012
1 parent 54e4a6f commit 18affdf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ng/directive/ngPluralize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 18affdf

Please sign in to comment.