import {isPresent} from 'angular2/src/facade/lang'; import {DOM} from 'angular2/src/dom/dom_adapter'; import {SetterFn} from 'angular2/src/reflection/types'; import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/facade/collection'; import {ElementBinder} from './element_binder'; import {NG_BINDING_CLASS} from '../util'; /** * Note: Code that uses this class assumes that is immutable! */ export class ProtoView { element; elementBinders:List; isTemplateElement:boolean; isRootView:boolean; rootBindingOffset:int; propertySetters: Map; constructor({ elementBinders, element, isRootView, propertySetters }) { this.element = element; this.elementBinders = elementBinders; this.isTemplateElement = DOM.isTemplateElement(this.element); this.isRootView = isRootView; this.rootBindingOffset = (isPresent(this.element) && DOM.hasClass(this.element, NG_BINDING_CLASS)) ? 1 : 0; this.propertySetters = propertySetters; } mergeChildComponentProtoViews(protoViews:List, target:List):ProtoView { var elementBinders = ListWrapper.createFixedSize(this.elementBinders.length); for (var i=0; i