
committed by
Miško Hevery

parent
4415855683
commit
e916836261
@ -1,12 +1,6 @@
|
||||
import {isPresent, isBlank, RegExpWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {Promise} from 'angular2/src/core/facade/async';
|
||||
import {
|
||||
List,
|
||||
Map,
|
||||
MapWrapper,
|
||||
StringMap,
|
||||
StringMapWrapper
|
||||
} from 'angular2/src/core/facade/collection';
|
||||
import {Map, MapWrapper, StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {
|
||||
ASTWithSource,
|
||||
ChangeDetectionStrategy
|
||||
@ -49,14 +43,14 @@ export class RenderElementBinder {
|
||||
index: number;
|
||||
parentIndex: number;
|
||||
distanceToParent: number;
|
||||
directives: List<DirectiveBinder>;
|
||||
directives: DirectiveBinder[];
|
||||
nestedProtoView: ProtoViewDto;
|
||||
propertyBindings: List<ElementPropertyBinding>;
|
||||
propertyBindings: ElementPropertyBinding[];
|
||||
variableBindings: Map<string, string>;
|
||||
// Note: this contains a preprocessed AST
|
||||
// that replaced the values that should be extracted from the element
|
||||
// with a local name
|
||||
eventBindings: List<EventBinding>;
|
||||
eventBindings: EventBinding[];
|
||||
readAttributes: Map<string, string>;
|
||||
|
||||
constructor({index, parentIndex, distanceToParent, directives, nestedProtoView, propertyBindings,
|
||||
@ -64,11 +58,11 @@ export class RenderElementBinder {
|
||||
index?: number,
|
||||
parentIndex?: number,
|
||||
distanceToParent?: number,
|
||||
directives?: List<DirectiveBinder>,
|
||||
directives?: DirectiveBinder[],
|
||||
nestedProtoView?: ProtoViewDto,
|
||||
propertyBindings?: List<ElementPropertyBinding>,
|
||||
propertyBindings?: ElementPropertyBinding[],
|
||||
variableBindings?: Map<string, string>,
|
||||
eventBindings?: List<EventBinding>,
|
||||
eventBindings?: EventBinding[],
|
||||
readAttributes?: Map<string, string>
|
||||
} = {}) {
|
||||
this.index = index;
|
||||
@ -90,13 +84,13 @@ export class DirectiveBinder {
|
||||
// Note: this contains a preprocessed AST
|
||||
// that replaced the values that should be extracted from the element
|
||||
// with a local name
|
||||
eventBindings: List<EventBinding>;
|
||||
hostPropertyBindings: List<ElementPropertyBinding>;
|
||||
eventBindings: EventBinding[];
|
||||
hostPropertyBindings: ElementPropertyBinding[];
|
||||
constructor({directiveIndex, propertyBindings, eventBindings, hostPropertyBindings}: {
|
||||
directiveIndex?: number,
|
||||
propertyBindings?: Map<string, ASTWithSource>,
|
||||
eventBindings?: List<EventBinding>,
|
||||
hostPropertyBindings?: List<ElementPropertyBinding>
|
||||
eventBindings?: EventBinding[],
|
||||
hostPropertyBindings?: ElementPropertyBinding[]
|
||||
}) {
|
||||
this.directiveIndex = directiveIndex;
|
||||
this.propertyBindings = propertyBindings;
|
||||
@ -119,19 +113,19 @@ export enum ViewType {
|
||||
|
||||
export class ProtoViewDto {
|
||||
render: RenderProtoViewRef;
|
||||
elementBinders: List<RenderElementBinder>;
|
||||
elementBinders: RenderElementBinder[];
|
||||
variableBindings: Map<string, string>;
|
||||
type: ViewType;
|
||||
textBindings: List<ASTWithSource>;
|
||||
textBindings: ASTWithSource[];
|
||||
transitiveNgContentCount: number;
|
||||
|
||||
constructor({render, elementBinders, variableBindings, type, textBindings,
|
||||
transitiveNgContentCount}: {
|
||||
render?: RenderProtoViewRef,
|
||||
elementBinders?: List<RenderElementBinder>,
|
||||
elementBinders?: RenderElementBinder[],
|
||||
variableBindings?: Map<string, string>,
|
||||
type?: ViewType,
|
||||
textBindings?: List<ASTWithSource>,
|
||||
textBindings?: ASTWithSource[],
|
||||
transitiveNgContentCount?: number
|
||||
}) {
|
||||
this.render = render;
|
||||
@ -149,9 +143,9 @@ export class RenderDirectiveMetadata {
|
||||
id: any;
|
||||
selector: string;
|
||||
compileChildren: boolean;
|
||||
events: List<string>;
|
||||
properties: List<string>;
|
||||
readAttributes: List<string>;
|
||||
events: string[];
|
||||
properties: string[];
|
||||
readAttributes: string[];
|
||||
type: number;
|
||||
callOnDestroy: boolean;
|
||||
callOnChanges: boolean;
|
||||
@ -177,12 +171,12 @@ export class RenderDirectiveMetadata {
|
||||
id?: string,
|
||||
selector?: string,
|
||||
compileChildren?: boolean,
|
||||
events?: List<string>,
|
||||
events?: string[],
|
||||
hostListeners?: Map<string, string>,
|
||||
hostProperties?: Map<string, string>,
|
||||
hostAttributes?: Map<string, string>,
|
||||
properties?: List<string>,
|
||||
readAttributes?: List<string>,
|
||||
properties?: string[],
|
||||
readAttributes?: string[],
|
||||
type?: number,
|
||||
callOnDestroy?: boolean,
|
||||
callOnChanges?: boolean,
|
||||
@ -224,10 +218,10 @@ export class RenderDirectiveMetadata {
|
||||
id?: string,
|
||||
selector?: string,
|
||||
compileChildren?: boolean,
|
||||
events?: List<string>,
|
||||
events?: string[],
|
||||
host?: Map<string, string>,
|
||||
properties?: List<string>,
|
||||
readAttributes?: List<string>,
|
||||
properties?: string[],
|
||||
readAttributes?: string[],
|
||||
type?: number,
|
||||
callOnDestroy?: boolean,
|
||||
callOnChanges?: boolean,
|
||||
@ -314,9 +308,9 @@ export class ViewDefinition {
|
||||
componentId: string;
|
||||
templateAbsUrl: string;
|
||||
template: string;
|
||||
directives: List<RenderDirectiveMetadata>;
|
||||
styleAbsUrls: List<string>;
|
||||
styles: List<string>;
|
||||
directives: RenderDirectiveMetadata[];
|
||||
styleAbsUrls: string[];
|
||||
styles: string[];
|
||||
encapsulation: ViewEncapsulation;
|
||||
|
||||
constructor({componentId, templateAbsUrl, template, styleAbsUrls, styles, directives,
|
||||
@ -324,9 +318,9 @@ export class ViewDefinition {
|
||||
componentId?: string,
|
||||
templateAbsUrl?: string,
|
||||
template?: string,
|
||||
styleAbsUrls?: List<string>,
|
||||
styles?: List<string>,
|
||||
directives?: List<RenderDirectiveMetadata>,
|
||||
styleAbsUrls?: string[],
|
||||
styles?: string[],
|
||||
directives?: RenderDirectiveMetadata[],
|
||||
encapsulation?: ViewEncapsulation
|
||||
} = {}) {
|
||||
this.componentId = componentId;
|
||||
@ -381,11 +375,11 @@ export class RenderCompiler {
|
||||
* should be merged.
|
||||
* If the array contains other arrays, they will be merged before processing the parent array.
|
||||
* The array must contain an entry for every component and embedded ProtoView of the first entry.
|
||||
* @param protoViewRefs List of ProtoViewRefs or nested
|
||||
* @param protoViewRefs Array of ProtoViewRefs or nested
|
||||
* @return the merge result
|
||||
*/
|
||||
mergeProtoViewsRecursively(
|
||||
protoViewRefs: List<RenderProtoViewRef | List<any>>): Promise<RenderProtoViewMergeMapping> {
|
||||
protoViewRefs: Array<RenderProtoViewRef | any[]>): Promise<RenderProtoViewMergeMapping> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -500,7 +494,7 @@ export class Renderer {
|
||||
/**
|
||||
* Calls a method on an element.
|
||||
*/
|
||||
invokeElementMethod(location: RenderElementRef, methodName: string, args: List<any>) {}
|
||||
invokeElementMethod(location: RenderElementRef, methodName: string, args: any[]) {}
|
||||
|
||||
/**
|
||||
* Sets the value of a text node.
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {isBlank} from 'angular2/src/core/facade/lang';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {CompileElement} from './compile_element';
|
||||
import {CompileStep} from './compile_step';
|
||||
|
||||
@ -14,7 +13,7 @@ export class CompileControl {
|
||||
_additionalChildren: CompileElement[] = null;
|
||||
_ignoreCurrentElement: boolean;
|
||||
|
||||
constructor(public _steps: List<CompileStep>) {}
|
||||
constructor(public _steps: CompileStep[]) {}
|
||||
|
||||
// only public so that it can be used by compile_pipeline
|
||||
internalProcess(results: any[], startStepIndex: number, parent: CompileElement,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {
|
||||
isBlank,
|
||||
@ -17,7 +17,7 @@ import {ProtoViewBuilder, ElementBinderBuilder} from '../view/proto_view_builder
|
||||
*/
|
||||
export class CompileElement {
|
||||
_attrs: Map<string, string> = null;
|
||||
_classList: List<string> = null;
|
||||
_classList: string[] = null;
|
||||
isViewRoot: boolean = false;
|
||||
// inherited down to children if they don't have an own protoView
|
||||
inheritedProtoView: ProtoViewBuilder = null;
|
||||
@ -63,7 +63,7 @@ export class CompileElement {
|
||||
return this._attrs;
|
||||
}
|
||||
|
||||
classList(): List<string> {
|
||||
classList(): string[] {
|
||||
if (isBlank(this._classList)) {
|
||||
this._classList = [];
|
||||
var elClassList = DOM.classList(this.element);
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {isPresent, isBlank} from 'angular2/src/core/facade/lang';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {CompileElement} from './compile_element';
|
||||
import {CompileControl} from './compile_control';
|
||||
@ -13,7 +12,7 @@ import {ProtoViewDto, ViewType, ViewDefinition} from '../../api';
|
||||
*/
|
||||
export class CompilePipeline {
|
||||
_control: CompileControl;
|
||||
constructor(public steps: List<CompileStep>) { this._control = new CompileControl(steps); }
|
||||
constructor(public steps: CompileStep[]) { this._control = new CompileControl(steps); }
|
||||
|
||||
processStyles(styles: string[]): string[] {
|
||||
return styles.map(style => {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import {List} from 'angular2/src/core/facade/collection';
|
||||
import {Parser} from 'angular2/src/core/change_detection/change_detection';
|
||||
import {ViewDefinition} from '../../api';
|
||||
import {CompileStep} from './compile_step';
|
||||
@ -9,14 +8,14 @@ import {ViewSplitter} from './view_splitter';
|
||||
import {StyleEncapsulator} from './style_encapsulator';
|
||||
|
||||
export class CompileStepFactory {
|
||||
createSteps(view: ViewDefinition): List<CompileStep> { return null; }
|
||||
createSteps(view: ViewDefinition): CompileStep[] { return null; }
|
||||
}
|
||||
|
||||
export class DefaultStepFactory extends CompileStepFactory {
|
||||
private _componentUIDsCache: Map<string, string> = new Map();
|
||||
constructor(private _parser: Parser, private _appId: string) { super(); }
|
||||
|
||||
createSteps(view: ViewDefinition): List<CompileStep> {
|
||||
createSteps(view: ViewDefinition): CompileStep[] {
|
||||
return [
|
||||
new ViewSplitter(this._parser),
|
||||
new PropertyBindingParser(this._parser),
|
||||
|
@ -68,7 +68,7 @@ export class DomCompiler extends RenderCompiler {
|
||||
}
|
||||
|
||||
mergeProtoViewsRecursively(
|
||||
protoViewRefs: List<RenderProtoViewRef | List<any>>): Promise<RenderProtoViewMergeMapping> {
|
||||
protoViewRefs: Array<RenderProtoViewRef | any[]>): Promise<RenderProtoViewMergeMapping> {
|
||||
return PromiseWrapper.resolve(
|
||||
pvm.mergeProtoViewsRecursively(this._templateCloner, protoViewRefs));
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {isPresent, isBlank, BaseException, StringWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {List, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {Parser} from 'angular2/src/core/change_detection/change_detection';
|
||||
|
||||
@ -21,7 +21,7 @@ import {DirectiveBuilder, ElementBinderBuilder} from '../view/proto_view_builder
|
||||
export class DirectiveParser implements CompileStep {
|
||||
_selectorMatcher: SelectorMatcher = new SelectorMatcher();
|
||||
|
||||
constructor(public _parser: Parser, public _directives: List<RenderDirectiveMetadata>) {
|
||||
constructor(public _parser: Parser, public _directives: RenderDirectiveMetadata[]) {
|
||||
for (var i = 0; i < _directives.length; i++) {
|
||||
var directive = _directives[i];
|
||||
var selector = CssSelector.parse(directive.selector);
|
||||
@ -114,7 +114,7 @@ export class DirectiveParser implements CompileStep {
|
||||
let dirProperty: string;
|
||||
// Name of the property on the element
|
||||
let elProp: string;
|
||||
let pipes: List<string>;
|
||||
let pipes: string[];
|
||||
let assignIndex: number = bindConfig.indexOf(':');
|
||||
|
||||
if (assignIndex > -1) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {Map, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {
|
||||
isPresent,
|
||||
isBlank,
|
||||
@ -322,7 +322,7 @@ export class SelectorMatcher {
|
||||
var selectables = map.get(name);
|
||||
var starSelectables = map.get("*");
|
||||
if (isPresent(starSelectables)) {
|
||||
selectables = ListWrapper.concat(selectables, starSelectables);
|
||||
selectables = selectables.concat(starSelectables);
|
||||
}
|
||||
if (isBlank(selectables)) {
|
||||
return false;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {
|
||||
StringWrapper,
|
||||
RegExp,
|
||||
|
@ -42,8 +42,7 @@ export class StyleInliner {
|
||||
return this._inlineImports(cssText, baseUrl, []);
|
||||
}
|
||||
|
||||
_inlineImports(cssText: string, baseUrl: string, inlinedUrls: List<string>): Promise<string>|
|
||||
string {
|
||||
_inlineImports(cssText: string, baseUrl: string, inlinedUrls: string[]): Promise<string>| string {
|
||||
var partIndex = 0;
|
||||
var parts = StringWrapper.split(cssText, _importRe);
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
isPromise,
|
||||
StringWrapper
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
import {Map, MapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection';
|
||||
import {Map, MapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {ViewDefinition} from '../../api';
|
||||
@ -35,7 +35,7 @@ export class ViewLoader {
|
||||
|
||||
load(viewDef: ViewDefinition): Promise<TemplateAndStyles> {
|
||||
var r = wtfStartTimeRange('ViewLoader#load()', stringify(viewDef.componentId));
|
||||
let tplAndStyles: List<Promise<TemplateAndStyles>| Promise<string>| string> =
|
||||
let tplAndStyles: Array<Promise<TemplateAndStyles>| Promise<string>| string> =
|
||||
[this._loadHtml(viewDef.template, viewDef.templateAbsUrl, viewDef.componentId)];
|
||||
if (isPresent(viewDef.styles)) {
|
||||
viewDef.styles.forEach((cssText: string) => {
|
||||
@ -54,7 +54,7 @@ export class ViewLoader {
|
||||
|
||||
// Inline the styles from the @View annotation
|
||||
return PromiseWrapper.all(tplAndStyles)
|
||||
.then((res: List<TemplateAndStyles | string>) => {
|
||||
.then((res: Array<TemplateAndStyles | string>) => {
|
||||
let loadedTplAndStyles = <TemplateAndStyles>res[0];
|
||||
let styles = <string[]>ListWrapper.slice(res, 1);
|
||||
|
||||
|
@ -6,13 +6,6 @@ import {
|
||||
RegExpWrapper,
|
||||
CONST_EXPR
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
import {
|
||||
ListWrapper,
|
||||
MapWrapper,
|
||||
Map,
|
||||
StringMapWrapper,
|
||||
List
|
||||
} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
|
||||
@ -96,9 +89,7 @@ export class DomRenderer extends Renderer {
|
||||
.boundElements[location.renderBoundElementIndex];
|
||||
}
|
||||
|
||||
getRootNodes(fragment: RenderFragmentRef): List<Node> {
|
||||
return resolveInternalDomFragment(fragment);
|
||||
}
|
||||
getRootNodes(fragment: RenderFragmentRef): Node[] { return resolveInternalDomFragment(fragment); }
|
||||
|
||||
attachFragmentAfterFragment(previousFragmentRef: RenderFragmentRef,
|
||||
fragmentRef: RenderFragmentRef) {
|
||||
@ -194,7 +185,7 @@ export class DomRenderer extends Renderer {
|
||||
view.setElementStyle(location.renderBoundElementIndex, styleName, styleValue);
|
||||
}
|
||||
|
||||
invokeElementMethod(location: RenderElementRef, methodName: string, args: List<any>): void {
|
||||
invokeElementMethod(location: RenderElementRef, methodName: string, args: any[]): void {
|
||||
if (isBlank(location.renderBoundElementIndex)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
import {isBlank, BaseException, isPresent, StringWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {List, ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||
|
||||
var BUBBLE_SYMBOL = '^';
|
||||
|
||||
export class EventManager {
|
||||
constructor(public _plugins: List<EventManagerPlugin>, public _zone: NgZone) {
|
||||
constructor(public _plugins: EventManagerPlugin[], public _zone: NgZone) {
|
||||
for (var i = 0; i < _plugins.length; i++) {
|
||||
_plugins[i].manager = this;
|
||||
}
|
||||
|
@ -1,22 +1,21 @@
|
||||
import {AST} from 'angular2/src/core/change_detection/change_detection';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {isPresent} from 'angular2/src/core/facade/lang';
|
||||
|
||||
export class DomElementBinder {
|
||||
textNodeIndices: List<number>;
|
||||
textNodeIndices: number[];
|
||||
hasNestedProtoView: boolean;
|
||||
eventLocals: AST;
|
||||
localEvents: List<Event>;
|
||||
globalEvents: List<Event>;
|
||||
localEvents: Event[];
|
||||
globalEvents: Event[];
|
||||
hasNativeShadowRoot: boolean;
|
||||
|
||||
constructor({textNodeIndices, hasNestedProtoView, eventLocals, localEvents, globalEvents,
|
||||
hasNativeShadowRoot}: {
|
||||
textNodeIndices?: List<number>,
|
||||
textNodeIndices?: number[],
|
||||
hasNestedProtoView?: boolean,
|
||||
eventLocals?: AST,
|
||||
localEvents?: List<Event>,
|
||||
globalEvents?: List<Event>,
|
||||
localEvents?: Event[],
|
||||
globalEvents?: Event[],
|
||||
hasNativeShadowRoot?: boolean
|
||||
} = {}) {
|
||||
this.textNodeIndices = textNodeIndices;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import {DomElementBinder} from './element_binder';
|
||||
import {RenderProtoViewRef, ViewType, ViewEncapsulation} from '../../api';
|
||||
@ -18,7 +18,7 @@ export class DomProtoViewRef extends RenderProtoViewRef {
|
||||
export class DomProtoView {
|
||||
static create(templateCloner: TemplateCloner, type: ViewType, rootElement: Element,
|
||||
viewEncapsulation: ViewEncapsulation, fragmentsRootNodeCount: number[],
|
||||
rootTextNodeIndices: number[], elementBinders: List<DomElementBinder>,
|
||||
rootTextNodeIndices: number[], elementBinders: DomElementBinder[],
|
||||
hostAttributes: Map<string, string>): DomProtoView {
|
||||
var boundTextNodeCount = rootTextNodeIndices.length;
|
||||
for (var i = 0; i < elementBinders.length; i++) {
|
||||
@ -33,8 +33,7 @@ export class DomProtoView {
|
||||
}
|
||||
// Note: fragments are separated by a comment node that is not counted in fragmentsRootNodeCount!
|
||||
constructor(public type: ViewType, public cloneableTemplate: Element | string,
|
||||
public encapsulation: ViewEncapsulation,
|
||||
public elementBinders: List<DomElementBinder>,
|
||||
public encapsulation: ViewEncapsulation, public elementBinders: DomElementBinder[],
|
||||
public hostAttributes: Map<string, string>, public rootTextNodeIndices: number[],
|
||||
public boundTextNodeCount: number, public fragmentsRootNodeCount: number[],
|
||||
public isSingleElementFragment: boolean) {}
|
||||
|
@ -4,7 +4,6 @@ import {
|
||||
MapWrapper,
|
||||
Set,
|
||||
SetWrapper,
|
||||
List,
|
||||
StringMapWrapper
|
||||
} from 'angular2/src/core/facade/collection';
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
@ -39,7 +38,7 @@ import {EVENT_TARGET_SEPARATOR} from "../../event_config";
|
||||
|
||||
export class ProtoViewBuilder {
|
||||
variableBindings: Map<string, string> = new Map();
|
||||
elements: List<ElementBinderBuilder> = [];
|
||||
elements: ElementBinderBuilder[] = [];
|
||||
rootTextBindings: Map<Node, ASTWithSource> = new Map();
|
||||
ngContentCount: number = 0;
|
||||
hostAttributes: Map<string, string> = new Map();
|
||||
@ -153,11 +152,11 @@ export class ProtoViewBuilder {
|
||||
export class ElementBinderBuilder {
|
||||
parent: ElementBinderBuilder = null;
|
||||
distanceToParent: number = 0;
|
||||
directives: List<DirectiveBuilder> = [];
|
||||
directives: DirectiveBuilder[] = [];
|
||||
nestedProtoView: ProtoViewBuilder = null;
|
||||
propertyBindings: Map<string, ASTWithSource> = new Map();
|
||||
variableBindings: Map<string, string> = new Map();
|
||||
eventBindings: List<EventBinding> = [];
|
||||
eventBindings: EventBinding[] = [];
|
||||
eventBuilder: EventBuilder = new EventBuilder();
|
||||
textBindings: Map<Node, ASTWithSource> = new Map();
|
||||
readAttributes: Map<string, string> = new Map();
|
||||
@ -233,9 +232,9 @@ export class DirectiveBuilder {
|
||||
// mapping from directive property name to AST for that directive
|
||||
propertyBindings: Map<string, ASTWithSource> = new Map();
|
||||
// property names used in the template
|
||||
templatePropertyNames: List<string> = [];
|
||||
templatePropertyNames: string[] = [];
|
||||
hostPropertyBindings: Map<string, ASTWithSource> = new Map();
|
||||
eventBindings: List<EventBinding> = [];
|
||||
eventBindings: EventBinding[] = [];
|
||||
eventBuilder: EventBuilder = new EventBuilder();
|
||||
|
||||
constructor(public directiveIndex: number) {}
|
||||
@ -259,9 +258,9 @@ export class DirectiveBuilder {
|
||||
}
|
||||
|
||||
class EventBuilder extends AstTransformer {
|
||||
locals: List<AST> = [];
|
||||
localEvents: List<Event> = [];
|
||||
globalEvents: List<Event> = [];
|
||||
locals: AST[] = [];
|
||||
localEvents: Event[] = [];
|
||||
globalEvents: Event[] = [];
|
||||
_implicitReceiver: AST = new ImplicitReceiver();
|
||||
|
||||
constructor() { super(); }
|
||||
@ -303,19 +302,19 @@ class EventBuilder extends AstTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
buildEventLocals(): List<AST> { return this.locals; }
|
||||
buildEventLocals(): AST[] { return this.locals; }
|
||||
|
||||
buildLocalEvents(): List<Event> { return this.localEvents; }
|
||||
buildLocalEvents(): Event[] { return this.localEvents; }
|
||||
|
||||
buildGlobalEvents(): List<Event> { return this.globalEvents; }
|
||||
buildGlobalEvents(): Event[] { return this.globalEvents; }
|
||||
|
||||
merge(eventBuilder: EventBuilder) {
|
||||
this._merge(this.localEvents, eventBuilder.localEvents);
|
||||
this._merge(this.globalEvents, eventBuilder.globalEvents);
|
||||
ListWrapper.concat(this.locals, eventBuilder.locals);
|
||||
this.locals.concat(eventBuilder.locals);
|
||||
}
|
||||
|
||||
_merge(host: List<Event>, tobeAdded: List<Event>) {
|
||||
_merge(host: Event[], tobeAdded: Event[]) {
|
||||
var names = [];
|
||||
for (var i = 0; i < host.length; i++) {
|
||||
names.push(host[i].fullName);
|
||||
@ -336,7 +335,7 @@ const STYLE_PREFIX = 'style';
|
||||
function buildElementPropertyBindings(
|
||||
schemaRegistry: ElementSchemaRegistry, protoElement: /*element*/ any, isNgComponent: boolean,
|
||||
bindingsInTemplate: Map<string, ASTWithSource>, directiveTemplatePropertyNames: Set<string>):
|
||||
List<ElementPropertyBinding> {
|
||||
ElementPropertyBinding[] {
|
||||
var propertyBindings = [];
|
||||
|
||||
MapWrapper.forEach(bindingsInTemplate, (ast, propertyNameInTemplate) => {
|
||||
|
@ -25,7 +25,7 @@ import {
|
||||
import {TemplateCloner} from '../template_cloner';
|
||||
|
||||
export function mergeProtoViewsRecursively(templateCloner: TemplateCloner,
|
||||
protoViewRefs: List<RenderProtoViewRef | List<any>>):
|
||||
protoViewRefs: Array<RenderProtoViewRef | any[]>):
|
||||
RenderProtoViewMergeMapping {
|
||||
// clone
|
||||
var clonedProtoViews = [];
|
||||
@ -77,7 +77,7 @@ export function mergeProtoViewsRecursively(templateCloner: TemplateCloner,
|
||||
}
|
||||
|
||||
function cloneProtoViews(
|
||||
templateCloner: TemplateCloner, protoViewRefs: List<RenderProtoViewRef | List<any>>,
|
||||
templateCloner: TemplateCloner, protoViewRefs: Array<RenderProtoViewRef | any[]>,
|
||||
targetClonedProtoViews: ClonedProtoView[], targetHostViewAndBinderIndices: number[][]) {
|
||||
var hostProtoView = resolveInternalDomProtoView(protoViewRefs[0]);
|
||||
var hostPvIdx = targetClonedProtoViews.length;
|
||||
|
@ -1,11 +1,5 @@
|
||||
import {DOM} from 'angular2/src/core/dom/dom_adapter';
|
||||
import {
|
||||
ListWrapper,
|
||||
MapWrapper,
|
||||
Map,
|
||||
StringMapWrapper,
|
||||
List
|
||||
} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, MapWrapper, Map, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {isPresent, isBlank, BaseException, stringify} from 'angular2/src/core/facade/lang';
|
||||
|
||||
import {DomProtoView} from './proto_view';
|
||||
@ -27,9 +21,9 @@ export class DomViewRef extends RenderViewRef {
|
||||
export class DomView {
|
||||
hydrated: boolean = false;
|
||||
eventDispatcher: RenderEventDispatcher = null;
|
||||
eventHandlerRemovers: List<Function> = [];
|
||||
eventHandlerRemovers: Function[] = [];
|
||||
|
||||
constructor(public proto: DomProtoView, public boundTextNodes: List<Node>,
|
||||
constructor(public proto: DomProtoView, public boundTextNodes: Node[],
|
||||
public boundElements: Element[]) {}
|
||||
|
||||
setElementProperty(elementIndex: number, propertyName: string, value: any) {
|
||||
@ -65,7 +59,7 @@ export class DomView {
|
||||
}
|
||||
}
|
||||
|
||||
invokeElementMethod(elementIndex: number, methodName: string, args: List<any>) {
|
||||
invokeElementMethod(elementIndex: number, methodName: string, args: any[]) {
|
||||
var element = this.boundElements[elementIndex];
|
||||
DOM.invoke(element, methodName, args);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {ListWrapper, MapWrapper, List} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import * as viewModule from './view';
|
||||
|
||||
export class DomViewContainer {
|
||||
// The order in this list matches the DOM order.
|
||||
views: List<viewModule.DomView> = [];
|
||||
views: Array<viewModule.DomView> = [];
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
import {XHR} from 'angular2/src/core/render/xhr';
|
||||
import {List, ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, Map, MapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {isBlank, isPresent, normalizeBlank, BaseException} from 'angular2/src/core/facade/lang';
|
||||
import {PromiseCompleter, PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
export class MockXHR extends XHR {
|
||||
private _expectations: List<_Expectation>;
|
||||
private _expectations: _Expectation[];
|
||||
private _definitions: Map<string, string>;
|
||||
private _requests: List<_PendingRequest>;
|
||||
private _requests: _PendingRequest[];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
Reference in New Issue
Block a user