fix(compiler): minor cleanups and fixes

Part of #3605
This commit is contained in:
Tobias Bosch
2015-09-18 10:33:23 -07:00
parent 9c9769047d
commit 0ed6fc4f6b
4 changed files with 25 additions and 8 deletions

View File

@ -15,6 +15,10 @@ import {
*/
@CONST()
export class CompiledTemplate {
static getChangeDetectorFromData(data: any[]): Function { return data[0]; }
static getCommandsFromData(data: any[]): TemplateCmd[] { return data[1]; }
static getSylesFromData(data: any[]): string[] { return data[2]; }
// Note: paramGetter is a function so that we can have cycles between templates!
// paramGetter returns a tuple with:
// - ChangeDetector factory function
@ -91,13 +95,11 @@ export function endElement(): TemplateCmd {
export class BeginComponentCmd implements TemplateCmd, IBeginElementCmd, RenderBeginComponentCmd {
isBound: boolean = true;
templateId: number;
component: Type;
constructor(public name: string, public attrNameAndValues: string[],
public eventTargetAndNames: string[],
public variableNameAndValues: Array<string | number>, public directives: Type[],
public nativeShadow: boolean, public ngContentIndex: number,
public template: CompiledTemplate) {
this.component = directives[0];
this.templateId = template.id;
}
visit(visitor: RenderCommandVisitor, context: any): any {