| 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()); |
| 8 | 9 |
| 9 class DirectiveRef { | 10 class DirectiveRef { |
| 10 final dom.Node element; | 11 final dom.Node element; |
| 11 final Type type; | 12 final Type type; |
| 12 final NgAnnotation annotation; | 13 final NgAnnotation annotation; |
| 13 final String value; | 14 final String value; |
| 14 final List<ApplyMapping> mappings = new List<ApplyMapping>(); | 15 final List<ApplyMapping> mappings = new List<ApplyMapping>(); |
| 15 | 16 |
| 16 BlockFactory blockFactory; | 17 BlockFactory blockFactory; |
| 17 | 18 |
| 18 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); | 19 DirectiveRef(this.element, this.type, this.annotation, [ this.value ]); |
| 19 | 20 |
| 20 String toString() { | 21 String toString() { |
| 21 var html = element is dom.Element ? (element as dom.Element).outerHtml : ele
ment.nodeValue; | 22 var html = element is dom.Element ? (element as dom.Element).outerHtml : ele
ment.nodeValue; |
| 22 return '{ element: $html, selector: ${annotation.selector}, value: $value }'
; | 23 return '{ element: $html, selector: ${annotation.selector}, value: $value, t
ype: $type }'; |
| 23 } | 24 } |
| 24 } | 25 } |
| 25 | 26 |
| 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 |