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 @@ -261,8 +261,19 @@ class Scope {
261
261
AST ast = rootScope._astParser (expression,
262
262
formatters: formatters, collection: collection);
263
263
264
+ return watch = watchAST (ast, fn, canChangeModel: canChangeModel);
265
+ }
266
+
267
+ /**
268
+ * Use [watch] to set up change detection on an pre-parsed AST.
269
+ *
270
+ * * [ast] The pre-parsed AST.
271
+ * * [reactionFn] : The function executed when a change is detected.
272
+ * * [canChangeModel] : Whether or not the [reactionFn] can change the model.
273
+ */
274
+ Watch watchAST (AST ast, ReactionFn reactionFn, {bool canChangeModel: true }) {
264
275
WatchGroup group = canChangeModel ? _readWriteGroup : _readOnlyGroup;
265
- return watch = group.watch (ast, fn );
276
+ return group.watch (ast, reactionFn );
266
277
}
267
278
static Map _oneTimeWarnings = {};
268
279
You can’t perform that action at this time.
0 commit comments