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:
Matias Niemelä
2019-02-12 12:04:44 -08:00
committed by Miško Hevery
parent b41da03f00
commit 627cecdfe2
13 changed files with 134 additions and 45 deletions

View File

@ -292,6 +292,13 @@ export const enum InitPhaseState {
InitPhaseCompleted = 0b11,
}
/**
* Set of instructions used to process host bindings efficiently.
*
* See VIEW_DATA.md for more information.
*/
export interface ExpandoInstructions extends Array<number|HostBindingsFunction<any>|null> {}
/**
* The static data for an LView (shared between all templates of a
* given type).
@ -401,7 +408,7 @@ export interface TView {
*
* See VIEW_DATA.md for more information.
*/
expandoInstructions: (number|HostBindingsFunction<any>|null)[]|null;
expandoInstructions: ExpandoInstructions|null;
/**
* Full registry of directives and components that may be found in this view.