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

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

Issue 19989002: Allow <template if="{{ expr }}"> to be equivalent to template bind (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | « no previous file | pkg/mdv/test/template_element_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 // This code is a port of Model-Driven-Views: 7 // This code is a port of Model-Driven-Views:
8 // https://github.com/polymer-project/mdv 8 // https://github.com/polymer-project/mdv
9 // The code mostly comes from src/template_element.js 9 // The code mostly comes from src/template_element.js
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 static Object resolveInputs(Map values) { 195 static Object resolveInputs(Map values) {
196 if (values.containsKey('if') && !_toBoolean(values['if'])) { 196 if (values.containsKey('if') && !_toBoolean(values['if'])) {
197 return null; 197 return null;
198 } 198 }
199 199
200 if (values.containsKey('repeat')) { 200 if (values.containsKey('repeat')) {
201 return values['repeat']; 201 return values['repeat'];
202 } 202 }
203 203
204 if (values.containsKey('bind')) { 204 if (values.containsKey('bind') || values.containsKey('if')) {
205 return [values['bind']]; 205 return [values['bind']];
206 } 206 }
207 207
208 return null; 208 return null;
209 } 209 }
210 210
211 void valueChanged(value) { 211 void valueChanged(value) {
212 // TODO(jmesserly): should PathObserver do this for us? 212 // TODO(jmesserly): should PathObserver do this for us?
213 var oldValue = _lastValue; 213 var oldValue = _lastValue;
214 _lastValue = value; 214 _lastValue = value;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 nodeExt._templateIterator = null; 362 nodeExt._templateIterator = null;
363 } 363 }
364 } 364 }
365 365
366 _nodeOrCustom(node).unbindAll(); 366 _nodeOrCustom(node).unbindAll();
367 for (var c = node.firstChild; c != null; c = c.nextNode) { 367 for (var c = node.firstChild; c != null; c = c.nextNode) {
368 _unbindAllRecursively(c); 368 _unbindAllRecursively(c);
369 } 369 }
370 } 370 }
371 } 371 }
OLDNEW
« no previous file with comments | « no previous file | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698