| Index: pkg/template_binding/lib/src/instance_binding_map.dart
|
| diff --git a/pkg/template_binding/lib/src/instance_binding_map.dart b/pkg/template_binding/lib/src/instance_binding_map.dart
|
| index ad34b6e6a5f29a9ab8c61f3cfaa082117f060359..bc4105ab4d4d16e3cd2a7e36f637fdb6538b71ae 100644
|
| --- a/pkg/template_binding/lib/src/instance_binding_map.dart
|
| +++ b/pkg/template_binding/lib/src/instance_binding_map.dart
|
| @@ -71,3 +71,17 @@ Node _cloneAndBindInstance(Node node, Node parent, Document stagingDocument,
|
| _processBindings(clone, bindings, model, instanceBindings);
|
| return clone;
|
| }
|
| +
|
| +// TODO(rafaelw): Setup a MutationObserver on content which clears the expando
|
| +// so that bindingMaps regenerate when template.content changes.
|
| +_getInstanceBindingMap(DocumentFragment content, BindingDelegate delegate) {
|
| + if (delegate == null) delegate = BindingDelegate._DEFAULT;
|
| +
|
| + if (delegate._bindingMaps == null) delegate._bindingMaps = new Expando();
|
| + var map = delegate._bindingMaps[content];
|
| + if (map == null) {
|
| + map = _createInstanceBindingMap(content, delegate);
|
| + delegate._bindingMaps[content] = map;
|
| + }
|
| + return map;
|
| +}
|
|
|