refactor(ivy): add ɵɵupdateSyntheticHostBinding command (#30670)

- Refactors `ɵɵcomponentHostSyntheticProperty` into `ɵɵupdateSyntheticHostBinding`, to better align it with other new instructions.

PR Close #30670
This commit is contained in:
Ben Lesh
2019-05-24 17:21:41 -07:00
committed by Misko Hevery
parent 680d38513b
commit b4e68025f8
9 changed files with 22 additions and 32 deletions

View File

@ -120,7 +120,7 @@ export {
ɵɵpropertyInterpolate7,
ɵɵpropertyInterpolate8,
ɵɵpropertyInterpolateV,
ɵɵcomponentHostSyntheticProperty,
ɵɵupdateSyntheticHostBinding,
ɵɵcomponentHostSyntheticListener,
ɵɵprojectionDef,
ɵɵreference,

View File

@ -39,7 +39,6 @@ export {
ɵɵclassMap,
ɵɵclassProp,
ɵɵcomponentHostSyntheticListener,
ɵɵcomponentHostSyntheticProperty,
ɵɵcontainer,
ɵɵcontainerRefreshEnd,
@ -119,6 +118,8 @@ export {
ɵɵtextInterpolate7,
ɵɵtextInterpolate8,
ɵɵtextInterpolateV,
ɵɵupdateSyntheticHostBinding,
} from './instructions/all';
export {RenderFlags} from './interfaces/definition';
export {CssSelectorList, ProjectionSlots} from './interfaces/projection';

View File

@ -110,10 +110,12 @@ export function ɵɵelementProperty<T>(
*
* @codeGenApi
*/
export function ɵɵcomponentHostSyntheticProperty<T>(
index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,
nativeOnly?: boolean) {
if (value !== NO_CHANGE) {
elementPropertyInternal(index, propName, value, sanitizer, nativeOnly, loadComponentRenderer);
export function ɵɵupdateSyntheticHostBinding<T>(
propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean) {
const index = getSelectedIndex();
// TODO(benlesh): remove bind call here.
const bound = ɵɵbind(value);
if (bound !== NO_CHANGE) {
elementPropertyInternal(index, propName, bound, sanitizer, nativeOnly, loadComponentRenderer);
}
}

View File

@ -88,7 +88,7 @@ export const angularCoreEnv: {[name: string]: Function} =
'ɵɵload': r3.ɵɵload,
'ɵɵprojection': r3.ɵɵprojection,
'ɵɵelementProperty': r3.ɵɵelementProperty,
'ɵɵcomponentHostSyntheticProperty': r3.ɵɵcomponentHostSyntheticProperty,
'ɵɵupdateSyntheticHostBinding': r3.ɵɵupdateSyntheticHostBinding,
'ɵɵcomponentHostSyntheticListener': r3.ɵɵcomponentHostSyntheticListener,
'ɵɵpipeBind1': r3.ɵɵpipeBind1,
'ɵɵpipeBind2': r3.ɵɵpipeBind2,