OLD | NEW |
1 part of angular.core.dom; | 1 part of angular.core.dom_internal; |
2 | 2 |
3 List<dom.Node> cloneElements(elements) { | 3 List<dom.Node> cloneElements(elements) { |
4 return elements.map((el) => el.clone(true)).toList(); | 4 return elements.map((el) => el.clone(true)).toList(); |
5 } | 5 } |
6 | 6 |
7 typedef ApplyMapping(NodeAttrs attrs, Scope scope, Object dst, | 7 class MappingParts { |
8 FilterMap filters, notify()); | 8 final String attrName; |
| 9 final String mode; |
| 10 final String dstExpression; |
| 11 final String originalValue; |
| 12 |
| 13 const MappingParts(this.attrName, this.mode, this.dstExpression, this.original
Value); |
| 14 } |
9 | 15 |
10 class DirectiveRef { | 16 class DirectiveRef { |
11 final dom.Node element; | 17 final dom.Node element; |
12 final Type type; | 18 final Type type; |
13 final NgAnnotation annotation; | 19 final Directive annotation; |
14 final String value; | 20 final String value; |
15 final List<ApplyMapping> mappings = new List<ApplyMapping>(); | 21 final mappings = new List<MappingParts>(); |
16 | |
17 BlockFactory blockFactory; | |
18 | 22 |
19 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); | 23 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); |
20 | 24 |
21 String toString() { | 25 String toString() { |
22 var html = element is dom.Element ? (element as dom.Element).outerHtml : ele
ment.nodeValue; | 26 var html = element is dom.Element |
23 return '{ element: $html, selector: ${annotation.selector}, value: $value, t
ype: $type }'; | 27 ? (element as dom.Element).outerHtml |
| 28 : element.nodeValue; |
| 29 return '{ element: $html, selector: ${annotation.selector}, value: $value, ' |
| 30 'type: $type }'; |
24 } | 31 } |
25 } | 32 } |
26 | 33 |
27 /** | 34 /** |
28 * Creates a child injector that allows loading new directives, filters and | 35 * Creates a child injector that allows loading new directives, formatters and |
29 * services from the provided modules. | 36 * services from the provided modules. |
30 */ | 37 */ |
31 Injector forceNewDirectivesAndFilters(Injector injector, List<Module> modules) { | 38 Injector forceNewDirectivesAndFilters(Injector injector, List<Module> modules) { |
32 modules.add(new Module()..factory(Scope, (i) { | 39 modules.add(new Module() |
33 var scope = i.parent.get(Scope); | 40 ..factory(Scope, (i) { |
34 return scope.createChild(new PrototypeMap(scope.context)); | 41 var scope = i.parent.get(Scope); |
35 })); | 42 return scope.createChild(new PrototypeMap(scope.context)); |
| 43 })); |
| 44 |
36 return injector.createChild(modules, | 45 return injector.createChild(modules, |
37 forceNewInstances: [DirectiveMap, FilterMap]); | 46 forceNewInstances: [DirectiveMap, FormatterMap]); |
38 } | 47 } |
OLD | NEW |