63 lines
1.6 KiB
JavaScript
Raw Normal View History

import {isBlank, isPresent} from 'angular2/src/facade/lang';
import {AST} from 'angular2/change_detection';
2015-04-02 14:40:49 -07:00
import {SetterFn} from 'angular2/src/reflection/types';
import {List, ListWrapper} from 'angular2/src/facade/collection';
import * as protoViewModule from './proto_view';
export class ElementBinder {
contentTagSelector: string;
textNodeIndices: List<number>;
nestedProtoView: protoViewModule.RenderProtoView;
eventLocals: AST;
localEvents: List<Event>;
globalEvents: List<Event>;
componentId: string;
parentIndex:number;
distanceToParent:number;
2015-04-02 14:40:49 -07:00
propertySetters: Map<string, SetterFn>;
constructor({
textNodeIndices,
contentTagSelector,
nestedProtoView,
componentId,
eventLocals,
localEvents,
globalEvents,
parentIndex,
2015-04-02 14:40:49 -07:00
distanceToParent,
propertySetters
}) {
this.textNodeIndices = textNodeIndices;
this.contentTagSelector = contentTagSelector;
this.nestedProtoView = nestedProtoView;
this.componentId = componentId;
this.eventLocals = eventLocals;
this.localEvents = localEvents;
this.globalEvents = globalEvents;
this.parentIndex = parentIndex;
this.distanceToParent = distanceToParent;
2015-04-02 14:40:49 -07:00
this.propertySetters = propertySetters;
}
hasStaticComponent() {
return isPresent(this.componentId) && isPresent(this.nestedProtoView);
}
hasDynamicComponent() {
return isPresent(this.componentId) && isBlank(this.nestedProtoView);
}
}
export class Event {
name: string;
target: string;
fullName: string;
constructor(name: string, target: string, fullName: string) {
this.name = name;
this.target = target;
this.fullName = fullName;
}
}