2015-03-23 14:10:55 -07:00
|
|
|
import {isPresent} from 'angular2/src/facade/lang';
|
|
|
|
|
import {DOM} from 'angular2/src/dom/dom_adapter';
|
|
|
|
|
|
2015-05-06 10:49:42 -07:00
|
|
|
import {List} from 'angular2/src/facade/collection';
|
2015-03-23 14:10:55 -07:00
|
|
|
|
|
|
|
|
import {ElementBinder} from './element_binder';
|
|
|
|
|
import {NG_BINDING_CLASS} from '../util';
|
|
|
|
|
|
2015-05-06 10:49:42 -07:00
|
|
|
import {RenderProtoViewRef} from '../../api';
|
|
|
|
|
|
|
|
|
|
export function resolveInternalDomProtoView(protoViewRef:RenderProtoViewRef) {
|
|
|
|
|
var domProtoViewRef:DomProtoViewRef = protoViewRef;
|
|
|
|
|
return domProtoViewRef._protoView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class DomProtoViewRef extends RenderProtoViewRef {
|
|
|
|
|
_protoView:DomProtoView;
|
|
|
|
|
constructor(protoView:DomProtoView) {
|
|
|
|
|
super();
|
|
|
|
|
this._protoView = protoView;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-06 11:22:28 -07:00
|
|
|
export class DomProtoView {
|
2015-03-23 14:10:55 -07:00
|
|
|
element;
|
|
|
|
|
elementBinders:List<ElementBinder>;
|
|
|
|
|
isTemplateElement:boolean;
|
|
|
|
|
rootBindingOffset:int;
|
|
|
|
|
|
|
|
|
|
constructor({
|
|
|
|
|
elementBinders,
|
2015-05-06 10:49:42 -07:00
|
|
|
element
|
2015-03-23 14:10:55 -07:00
|
|
|
}) {
|
|
|
|
|
this.element = element;
|
|
|
|
|
this.elementBinders = elementBinders;
|
2015-05-06 10:49:42 -07:00
|
|
|
this.isTemplateElement = DOM.isTemplateElement(this.element);
|
|
|
|
|
this.rootBindingOffset = (isPresent(this.element) && DOM.hasClass(this.element, NG_BINDING_CLASS)) ? 1 : 0;
|
2015-03-23 14:10:55 -07:00
|
|
|
}
|
|
|
|
|
}
|