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

Side by Side Diff: pkg/mdv/lib/src/template.dart

Issue 22253002: fix packages for latest SDK changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/mdv/lib/src/node.dart ('k') | pkg/mdv/test/custom_element_bindings_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of mdv; 5 part of mdv;
6 6
7 /** Extensions to [Element]s that behave as templates. */ 7 /** Extensions to [Element]s that behave as templates. */
8 class _TemplateExtension extends _ElementExtension { 8 class _TemplateExtension extends _ElementExtension {
9 var _model; 9 var _model;
10 BindingDelegate _bindingDelegate; 10 BindingDelegate _bindingDelegate;
(...skipping 23 matching lines...) Expand all
34 /** 34 /**
35 * Creates an instance of the template. 35 * Creates an instance of the template.
36 */ 36 */
37 DocumentFragment createInstance(model, BindingDelegate delegate) { 37 DocumentFragment createInstance(model, BindingDelegate delegate) {
38 var template = node.ref; 38 var template = node.ref;
39 if (template == null) template = node; 39 if (template == null) template = node;
40 40
41 var instance = _createDeepCloneAndDecorateTemplates( 41 var instance = _createDeepCloneAndDecorateTemplates(
42 template.ref.content, delegate); 42 template.ref.content, delegate);
43 43
44 if (_instanceCreated != null) _instanceCreated.add(instance); 44 if (_instanceCreated != null) {
45 for (var callback in _instanceCreated) callback(instance);
46 }
45 47
46 _addBindings(instance, model, delegate); 48 _addBindings(instance, model, delegate);
47 _addTemplateInstanceRecord(instance, model); 49 _addTemplateInstanceRecord(instance, model);
48 return instance; 50 return instance;
49 } 51 }
50 52
51 /** 53 /**
52 * The data model which is inherited through the tree. 54 * The data model which is inherited through the tree.
53 */ 55 */
54 get model => _model; 56 get model => _model;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void _observePath() {} 95 void _observePath() {}
94 void boundValueChanged(newValue) {} 96 void boundValueChanged(newValue) {}
95 97
96 void close() { 98 void close() {
97 if (closed) return; 99 if (closed) return;
98 var templateIterator = _mdv(node)._templateIterator; 100 var templateIterator = _mdv(node)._templateIterator;
99 if (templateIterator != null) templateIterator.inputs.unbind(property); 101 if (templateIterator != null) templateIterator.inputs.unbind(property);
100 super.close(); 102 super.close();
101 } 103 }
102 } 104 }
OLDNEW
« no previous file with comments | « pkg/mdv/lib/src/node.dart ('k') | pkg/mdv/test/custom_element_bindings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698