File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,19 @@ class Scope {
240
240
AST ast = rootScope._astParser (expression,
241
241
formatters: formatters, collection: collection);
242
242
243
+ return watch = watchAST (ast, fn, canChangeModel: canChangeModel);
244
+ }
245
+
246
+ /**
247
+ * Use [watch] to set up change detection on an pre-parsed AST.
248
+ *
249
+ * * [ast] The pre-parsed AST.
250
+ * * [reactionFn] : The function executed when a change is detected.
251
+ * * [canChangeModel] : Whether or not the [reactionFn] can change the model.
252
+ */
253
+ Watch watchAST (AST ast, ReactionFn reactionFn, {bool canChangeModel: true }) {
243
254
WatchGroup group = canChangeModel ? _readWriteGroup : _readOnlyGroup;
244
- return watch = group.watch (ast, fn );
255
+ return group.watch (ast, reactionFn );
245
256
}
246
257
247
258
dynamic eval (expression, [Map locals]) {
You can’t perform that action at this time.
0 commit comments