diff options
| author | Brian Ford | 2012-07-19 01:10:12 -0700 |
|---|---|---|
| committer | Igor Minar | 2012-08-13 09:48:23 -0700 |
| commit | e85774f709b9f681b0ff8d829b07568b0f844a62 (patch) | |
| tree | dab37854be2ae13084e1b5f2aeb61858d2bdbfae /src | |
| parent | 44345c74decfd2e303ada9c958af8e9a07bb8336 (diff) | |
| download | angular.js-e85774f709b9f681b0ff8d829b07568b0f844a62.tar.bz2 | |
fix(ngPluralize): fixes ng-pluralize when using non-standard start/end symbols
Closes #1134
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/directive/ngPluralize.js | 7 |
1 files changed, 5 insertions, 2 deletions
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() { |
