fix(ivy): ensure host bindings and host styling works on a root component (#28664)
Prior to this fix if a root component was instantiated it create host bindings, but never render them once update mode ran unless one or more slot-allocated bindings were issued. Since styling in Ivy does not make use of LView slots, the host bindings function never ran on the root component. This fix ensures that the `hostBindings` function does run for a root component and also renders the schedlued styling instructions when executed. Jira Issue: FW-1062 PR Close #28664
This commit is contained in:

committed by
Miško Hevery

parent
b41da03f00
commit
627cecdfe2
@ -317,3 +317,18 @@ export const INTERPOLATION_DELIMITER = `<60>`;
|
||||
export function isPropMetadataString(str: string): boolean {
|
||||
return str.indexOf(INTERPOLATION_DELIMITER) >= 0;
|
||||
}
|
||||
|
||||
export function applyOnCreateInstructions(tNode: TNode) {
|
||||
// there may be some instructions that need to run in a specific
|
||||
// order because the CREATE block in a directive runs before the
|
||||
// CREATE block in a template. To work around this instructions
|
||||
// can get access to the function array below and defer any code
|
||||
// to run after the element is created.
|
||||
let fns: Function[]|null;
|
||||
if (fns = tNode.onElementCreationFns) {
|
||||
for (let i = 0; i < fns.length; i++) {
|
||||
fns[i]();
|
||||
}
|
||||
tNode.onElementCreationFns = null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user