| OLD | NEW |
| 1 part of angular.core.dom; | 1 part of angular.core.dom; |
| 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 typedef ApplyMapping(NodeAttrs attrs, Scope scope, Object dst); |
| 8 FilterMap filters, notify()); | |
| 9 | 8 |
| 10 class DirectiveRef { | 9 class DirectiveRef { |
| 11 final dom.Node element; | 10 final dom.Node element; |
| 12 final Type type; | 11 final Type type; |
| 13 final NgAnnotation annotation; | 12 final NgAnnotation annotation; |
| 14 final String value; | 13 final String value; |
| 15 final List<ApplyMapping> mappings = new List<ApplyMapping>(); | 14 final List<ApplyMapping> mappings = new List<ApplyMapping>(); |
| 16 | 15 |
| 17 BlockFactory blockFactory; | 16 BlockFactory blockFactory; |
| 18 | 17 |
| 19 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); | 18 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); |
| 20 | 19 |
| 21 String toString() { | 20 String toString() { |
| 22 var html = element is dom.Element ? (element as dom.Element).outerHtml : ele
ment.nodeValue; | 21 var html = element is dom.Element ? (element as dom.Element).outerHtml : ele
ment.nodeValue; |
| 23 return '{ element: $html, selector: ${annotation.selector}, value: $value, t
ype: $type }'; | 22 return '{ element: $html, selector: ${annotation.selector}, value: $value }'
; |
| 24 } | 23 } |
| 25 } | 24 } |
| 26 | 25 |
| 27 /** | |
| 28 * Creates a child injector that allows loading new directives, filters and | |
| 29 * services from the provided modules. | |
| 30 */ | |
| 31 Injector forceNewDirectivesAndFilters(Injector injector, List<Module> modules) { | |
| 32 modules.add(new Module()..factory(Scope, (i) { | |
| 33 var scope = i.parent.get(Scope); | |
| 34 return scope.createChild(new PrototypeMap(scope.context)); | |
| 35 })); | |
| 36 return injector.createChild(modules, | |
| 37 forceNewInstances: [DirectiveMap, FilterMap]); | |
| 38 } | |
| OLD | NEW |