@@ -101,6 +101,7 @@ class NgPluralizeDirective {
101
101
Watch _watch;
102
102
103
103
static final RegExp IS_WHEN = new RegExp (r'^when-(minus-)?.' );
104
+
104
105
static const Map <String , Symbol > SYMBOLS = const {
105
106
'zero' : #zero,
106
107
'one' : #one,
@@ -111,11 +112,12 @@ class NgPluralizeDirective {
111
112
};
112
113
113
114
NgPluralizeDirective (this ._scope, this ._element, this ._interpolate,
114
- this ._filters, NodeAttrs attributes) {
115
- final whens = attributes['when' ] == null
115
+ this ._filters) {
116
+ var attrs = _element.attributes;
117
+ final whens = attrs['when' ] == null
116
118
? < String , String > {}
117
- : _scope.eval (attributes ['when' ]);
118
- _offset = attributes ['offset' ] == null ? 0 : int .parse (attributes ['offset' ]);
119
+ : _scope.eval (attrs ['when' ]);
120
+ _offset = attrs ['offset' ] == null ? 0 : int .parse (attrs ['offset' ]);
119
121
120
122
_element.attributes.keys.where ((k) => IS_WHEN .hasMatch (k)).forEach ((k) {
121
123
var ruleName = k
@@ -164,7 +166,6 @@ class NgPluralizeDirective {
164
166
}
165
167
}
166
168
167
-
168
169
void _setAndWatch (template) {
169
170
if (_watch != null ) _watch.remove ();
170
171
var expression = _expressionCache.putIfAbsent (template, () =>
@@ -175,4 +176,4 @@ class NgPluralizeDirective {
175
176
void _updateMarkup (text, previousText) {
176
177
if (text != previousText) _element.text = text;
177
178
}
178
- }
179
+ }
0 commit comments