This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ part of angular.directive;
9
9
*/
10
10
@NgDirective (
11
11
selector: '[ng-style]' ,
12
- map: const { 'ng-style' : '@styleExpression' })
12
+ map: const {'ng-style' : '@styleExpression' })
13
13
class NgStyleDirective {
14
14
final dom.Element _element;
15
15
final Scope _scope;
@@ -28,18 +28,19 @@ class NgStyleDirective {
28
28
set styleExpression (String value) {
29
29
_styleExpression = value;
30
30
if (_watch != null ) _watch.remove ();
31
- _watch = _scope.watch (_parser (_styleExpression, collection: true ), _onStyleChange);
31
+ _watch = _scope.watch (_parser (_styleExpression, collection: true ),
32
+ _onStyleChange, readOnly: true );
32
33
}
33
34
34
35
_onStyleChange (MapChangeRecord mapChangeRecord, _) {
35
36
if (mapChangeRecord != null ) {
36
37
dom.CssStyleDeclaration css = _element.style;
37
- fn (MapKeyValue kv) => css.setProperty (kv.key, kv.currentValue == null ? '' : kv.currentValue);
38
+ fn (MapKeyValue m) =>
39
+ css.setProperty (m.key, m.currentValue == null ? '' : m.currentValue);
38
40
39
- mapChangeRecord
40
- ..forEachRemoval (fn)
41
- ..forEachChange (fn)
42
- ..forEachAddition (fn);
41
+ mapChangeRecord..forEachRemoval (fn)
42
+ ..forEachChange (fn)
43
+ ..forEachAddition (fn);
43
44
}
44
45
}
45
46
}
You can’t perform that action at this time.
0 commit comments