Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 part of mdv; | |
| 6 | |
| 7 /** Extensions to the [Node] API. */ | |
| 8 class _NodeExtension { | |
| 9 final Node node; | |
| 10 | |
| 11 _NodeExtension(this.node); | |
| 12 | |
| 13 /** | |
| 14 * Binds the attribute [name] to the [path] of the [model]. | |
| 15 * Path is a String of accessors such as `foo.bar.baz`. | |
| 16 */ | |
| 17 void bind(String name, model, String path) { | |
| 18 // TODO(jmesserly): should we throw instead? | |
|
justinfagnani
2013/06/25 23:03:31
I don't think so
Jennifer Messerly
2013/06/26 23:09:12
thanks, removed TODO
| |
| 19 window.console.error('Unhandled binding to Node: ' | |
| 20 '$this $name $model $path'); | |
| 21 } | |
| 22 | |
| 23 /** Unbinds the attribute [name]. */ | |
| 24 void unbind(String name) {} | |
| 25 | |
| 26 /** Unbinds all bound attributes. */ | |
| 27 void unbindAll() {} | |
| 28 | |
| 29 TemplateInstance _templateInstance; | |
| 30 | |
| 31 /** Gets the template instance that instantiated this node, if any. */ | |
| 32 TemplateInstance get templateInstance => | |
| 33 _templateInstance != null ? _templateInstance : | |
| 34 (node.parent != null ? node.parent.templateInstance : null); | |
| 35 } | |
| OLD | NEW |