import { ListWrapper, MapWrapper, Map, StringMapWrapper, } from 'angular2/src/core/facade/collection'; import { AST, ChangeDetector, ChangeDetectorRef, ChangeDispatcher, DirectiveIndex, DirectiveRecord, BindingTarget, Locals, ProtoChangeDetector } from 'angular2/src/core/change_detection/change_detection'; import {DebugContext} from 'angular2/src/core/change_detection/interfaces'; import { ProtoElementInjector, ElementInjector, PreBuiltObjects, DirectiveBinding } from './element_injector'; import {ElementBinder} from './element_binder'; import {isPresent, isBlank} from 'angular2/src/core/facade/lang'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; import * as renderApi from 'angular2/src/core/render/api'; import {RenderEventDispatcher} from 'angular2/src/core/render/api'; import {ViewRef, ProtoViewRef, internalView} from './view_ref'; import {ElementRef} from './element_ref'; import {ProtoPipes} from 'angular2/src/core/pipes/pipes'; import {camelCaseToDashCase} from 'angular2/src/core/render/dom/util'; import {TemplateCmd} from './template_commands'; export {DebugContext} from 'angular2/src/core/change_detection/interfaces'; const REFLECT_PREFIX: string = 'ng-reflect-'; export class AppViewContainer { // The order in this list matches the DOM order. views: AppView[] = []; } /** * Cost of making objects: http://jsperf.com/instantiate-size-of-object * */ export class AppView implements ChangeDispatcher, RenderEventDispatcher { // AppViews that have been merged in depth first order. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. views: AppView[] = null; // root elementInjectors of this AppView // This list is local to this AppView and not shared with other Views. rootElementInjectors: ElementInjector[]; // ElementInjectors of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. elementInjectors: ElementInjector[] = null; // ViewContainers of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. viewContainers: AppViewContainer[] = null; // PreBuiltObjects of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. preBuiltObjects: PreBuiltObjects[] = null; // ElementRef of all AppViews in views grouped by view. // This list is shared between all merged views. Use this.elementOffset to get the local // entries. elementRefs: ElementRef[]; ref: ViewRef; changeDetector: ChangeDetector = null; /** * The context against which data-binding expressions in this view are evaluated against. * This is always a component instance. */ context: any = null; /** * Variables, local to this view, that can be used in binding expressions (in addition to the * context). This is used for thing like `