feat(ivy): generate ɵɵproperty in host bindings (#30009)

PR Close #30009
This commit is contained in:
Ben Lesh
2019-04-20 23:35:20 -07:00
parent 19dfadb717
commit 0f9230d018
4 changed files with 28 additions and 20 deletions

View File

@ -652,9 +652,17 @@ function createHostBindingsFunction(
}
}
const instructionParams: o.Expression[] = [
elVarExp, o.literal(bindingName), o.importExpr(R3.bind).callFn([bindingExpr.currValExpr])
];
const isPropertyInstruction = instruction === R3.property;
const instructionParams: o.Expression[] = isPropertyInstruction ?
[
o.literal(bindingName),
bindingExpr.currValExpr,
] :
[
elVarExp,
o.literal(bindingName),
o.importExpr(R3.bind).callFn([bindingExpr.currValExpr]),
];
if (sanitizerFn) {
instructionParams.push(sanitizerFn);
}
@ -762,7 +770,7 @@ function getBindingNameAndInstruction(binding: ParsedProperty):
// compatibility instruction available for this purpose.
instruction = R3.componentHostSyntheticProperty;
} else {
instruction = R3.elementProperty;
instruction = R3.property;
}
}