refactor(render): add DomElement

Replaces the multiple arrays of `DomView`
by a single array with `DomElement`s.

Note: this commit does not show a performance regression
(tested against the tree benchmark locally).
This commit is contained in:
Tobias Bosch
2015-06-02 10:15:16 -07:00
parent 0a50a3f564
commit 827841ec5b
11 changed files with 86 additions and 95 deletions

View File

@ -80,7 +80,7 @@ function _injectorBindings(appComponentType): List<Type | Binding | List<any>> {
var domView = resolveInternalDomView(componentRef.hostView.render);
// We need to do this here to ensure that we create Testability and
// it's ready on the window for users.
registry.registerApplication(domView.boundElements[0], testability);
registry.registerApplication(domView.boundElements[0].element, testability);
return componentRef;
});

View File

@ -23,7 +23,9 @@ export class ElementRef {
// We need a more general way to read/write to the DOM element
// via a proper abstraction in the render layer
get domElement() {
return resolveInternalDomView(this.parentView.render).boundElements[this.boundElementIndex];
return resolveInternalDomView(this.parentView.render)
.boundElements[this.boundElementIndex]
.element;
}
/**