diff --git a/modules/angular2/src/render/api.ts b/modules/angular2/src/render/api.ts index 6f92c5263a..81b8d34d90 100644 --- a/modules/angular2/src/render/api.ts +++ b/modules/angular2/src/render/api.ts @@ -20,13 +20,7 @@ import {ASTWithSource} from 'angular2/change_detection'; * its output will be stored in precompiled templates. */ export class EventBinding { - fullName: string; // name/target:name, e.g "click", "window:resize" - source: ASTWithSource; - - constructor(fullName: string, source: ASTWithSource) { - this.fullName = fullName; - this.source = source; - } + constructor(public fullName: string, public source: ASTWithSource) {} } export class ElementBinder { diff --git a/modules/angular2/src/render/dom/compiler/compile_control.ts b/modules/angular2/src/render/dom/compiler/compile_control.ts index 220d3ae6dd..7de94e4f24 100644 --- a/modules/angular2/src/render/dom/compiler/compile_control.ts +++ b/modules/angular2/src/render/dom/compiler/compile_control.ts @@ -8,20 +8,13 @@ import {CompileStep} from './compile_step'; * Right now it only allows to add a parent element. */ export class CompileControl { - _steps: List; - _currentStepIndex: number; - _parent: CompileElement; - _results; - _additionalChildren; + _currentStepIndex: number = 0; + _parent: CompileElement = null; + _results = null; + _additionalChildren = null; _ignoreCurrentElement: boolean; - constructor(steps) { - this._steps = steps; - this._currentStepIndex = 0; - this._parent = null; - this._results = null; - this._additionalChildren = null; - } + constructor(public _steps: List) {} // only public so that it can be used by compile_pipeline internalProcess(results, startStepIndex, parent: CompileElement, current: CompileElement) { diff --git a/modules/angular2/src/render/dom/compiler/compile_element.ts b/modules/angular2/src/render/dom/compiler/compile_element.ts index 01e70a83b9..0be9fb4616 100644 --- a/modules/angular2/src/render/dom/compiler/compile_element.ts +++ b/modules/angular2/src/render/dom/compiler/compile_element.ts @@ -10,30 +10,19 @@ import {ProtoViewBuilder, ElementBinderBuilder} from '../view/proto_view_builder * by the CompileSteps starting out with the pure HTMLElement. */ export class CompileElement { - element; - _attrs: Map; - _classList: List; - isViewRoot: boolean; - inheritedProtoView: ProtoViewBuilder; - distanceToInheritedBinder: number; - inheritedElementBinder: ElementBinderBuilder; - compileChildren: boolean; + _attrs: Map = null; + _classList: List = null; + isViewRoot: boolean = false; + // inherited down to children if they don't have an own protoView + inheritedProtoView: ProtoViewBuilder = null; + distanceToInheritedBinder: number = 0; + // inherited down to children if they don't have an own elementBinder + inheritedElementBinder: ElementBinderBuilder = null; + compileChildren: boolean = true; elementDescription: string; // e.g. '
' : used to provide context in case of // error - constructor(element, compilationUnit = '') { - this.element = element; - this._attrs = null; - this._classList = null; - this.isViewRoot = false; - // inherited down to children if they don't have - // an own protoView - this.inheritedProtoView = null; - // inherited down to children if they don't have - // an own elementBinder - this.inheritedElementBinder = null; - this.distanceToInheritedBinder = 0; - this.compileChildren = true; + constructor(public element, compilationUnit: string = '') { // description is calculated here as compilation steps may change the element var tplDesc = assertionsEnabled() ? getElementDescription(element) : null; if (compilationUnit !== '') { diff --git a/modules/angular2/src/render/dom/compiler/compile_step_factory.ts b/modules/angular2/src/render/dom/compiler/compile_step_factory.ts index dcb9e37cc3..4dd8c3a669 100644 --- a/modules/angular2/src/render/dom/compiler/compile_step_factory.ts +++ b/modules/angular2/src/render/dom/compiler/compile_step_factory.ts @@ -18,14 +18,7 @@ export class CompileStepFactory { } export class DefaultStepFactory extends CompileStepFactory { - _parser: Parser; - _shadowDomStrategy: ShadowDomStrategy; - - constructor(parser: Parser, shadowDomStrategy) { - super(); - this._parser = parser; - this._shadowDomStrategy = shadowDomStrategy; - } + constructor(public _parser: Parser, public _shadowDomStrategy: ShadowDomStrategy) { super(); } createSteps(template: ViewDefinition, subTaskPromises: List>) { return [ diff --git a/modules/angular2/src/render/dom/compiler/compiler.ts b/modules/angular2/src/render/dom/compiler/compiler.ts index 86d66ed985..7c9b0b6d3b 100644 --- a/modules/angular2/src/render/dom/compiler/compiler.ts +++ b/modules/angular2/src/render/dom/compiler/compiler.ts @@ -25,15 +25,10 @@ import {PropertySetterFactory} from '../view/property_setter_factory'; * the CompilePipeline and the CompileSteps. */ export class DomCompiler extends RenderCompiler { - _templateLoader: TemplateLoader; - _stepFactory: CompileStepFactory; - _propertySetterFactory: PropertySetterFactory; + _propertySetterFactory: PropertySetterFactory = new PropertySetterFactory(); - constructor(stepFactory: CompileStepFactory, templateLoader: TemplateLoader) { + constructor(public _stepFactory: CompileStepFactory, public _templateLoader: TemplateLoader) { super(); - this._templateLoader = templateLoader; - this._stepFactory = stepFactory; - this._propertySetterFactory = new PropertySetterFactory(); } compile(template: ViewDefinition): Promise { diff --git a/modules/angular2/src/render/dom/compiler/directive_parser.ts b/modules/angular2/src/render/dom/compiler/directive_parser.ts index 4000743411..0317ed6f93 100644 --- a/modules/angular2/src/render/dom/compiler/directive_parser.ts +++ b/modules/angular2/src/render/dom/compiler/directive_parser.ts @@ -18,25 +18,18 @@ import {CompileControl} from './compile_control'; import {DirectiveMetadata} from '../../api'; import {dashCaseToCamelCase, camelCaseToDashCase, EVENT_TARGET_SEPARATOR} from '../util'; -import { - DirectiveBuilder -} from '../view/proto_view_builder' +import {DirectiveBuilder} from '../view/proto_view_builder'; - /** - * Parses the directives on a single element. Assumes ViewSplitter has already created - *