diff --git a/packages/compiler/src/compiler_util/expression_converter.ts b/packages/compiler/src/compiler_util/expression_converter.ts index 99fe8f6570..9974d86492 100644 --- a/packages/compiler/src/compiler_util/expression_converter.ts +++ b/packages/compiler/src/compiler_util/expression_converter.ts @@ -15,7 +15,46 @@ export class EventHandlerVars { static event = o.variable('$event'); } export interface LocalResolver { getLocal(name: string): o.Expression|null; } export class ConvertActionBindingResult { - constructor(public stmts: o.Statement[], public allowDefault: o.ReadVarExpr) {} + /** + * Store statements which are render3 compatible. + */ + render3Stmts: o.Statement[]; + constructor( + /** + * Render2 compatible statements, + */ + public stmts: o.Statement[], + /** + * Variable name used with render2 compatible statements. + */ + public allowDefault: o.ReadVarExpr) { + /** + * This is bit of a hack. It converts statements which render2 expects to statements which are + * expected by render3. + * + * Example: `
... somewhere here ...
) private _inI18nSection: boolean = false; @@ -396,14 +447,19 @@ class TemplateDefinitionBuilder implements TemplateAstVisitor, LocalResolver { constructor( private outputCtx: OutputContext, private constantPool: ConstantPool, private reflector: CompileReflector, private contextParameter: string, - private bindingScope: BindingScope, private level = 0, private ngContentSelectors: string[], + parentBindingScope: BindingScope, private level = 0, private ngContentSelectors: string[], private contextName: string|null, private templateName: string|null, private pipes: Map