Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: pkg/mdv/lib/src/template.dart

Issue 18162004: [package:mdv] port createInstance change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/mdv/lib/src/element.dart ('k') | pkg/mdv/test/binding_syntax_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mdv/lib/src/template.dart
diff --git a/pkg/mdv/lib/src/template.dart b/pkg/mdv/lib/src/template.dart
index 9b379ea3cf28ef39b256cf97b06b831c1d98963d..a1713d1ccbc0c0ca92d241a5a507f6ff3cae921b 100644
--- a/pkg/mdv/lib/src/template.dart
+++ b/pkg/mdv/lib/src/template.dart
@@ -50,16 +50,17 @@ class _TemplateExtension extends _ElementExtension {
/**
* Creates an instance of the template.
*/
- DocumentFragment createInstance() {
+ DocumentFragment createInstance(model, String syntax) {
var template = node.ref;
if (template == null) template = node;
- var instance = _Bindings._createDeepCloneAndDecorateTemplates(
- template.content, node.attributes['syntax']);
+ var instance = _createDeepCloneAndDecorateTemplates(
+ template.content, syntax);
- if (_instanceCreated != null) {
- _instanceCreated.add(instance);
- }
+ if (_instanceCreated != null) _instanceCreated.add(instance);
+
+ _addBindings(instance, model, TemplateElement.syntax[syntax]);
+ _addTemplateInstanceRecord(instance, model);
return instance;
}
@@ -71,6 +72,6 @@ class _TemplateExtension extends _ElementExtension {
void set model(value) {
var syntax = TemplateElement.syntax[node.attributes['syntax']];
_model = value;
- _Bindings._addBindings(node, model, syntax);
+ _addBindings(node, model, syntax);
}
}
« no previous file with comments | « pkg/mdv/lib/src/element.dart ('k') | pkg/mdv/test/binding_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698