refactor(ivy): rename, limit usage of global vars (#24604)

PR Close #24604
This commit is contained in:
Pawel Kozlowski 2018-06-21 11:49:03 +02:00 committed by Miško Hevery
parent fba3f10938
commit 1e139d4339
3 changed files with 12 additions and 7 deletions

View File

@ -234,15 +234,16 @@ export function leaveView(newView: LViewData, creationOnly?: boolean): void {
/**
* Refreshes the view, executing the following steps in that order:
* triggers init hooks, refreshes dynamic children, triggers content hooks, sets host bindings,
* triggers init hooks, refreshes dynamic embedded views, triggers content hooks, sets host
* bindings,
* refreshes child components.
* Note: view hooks are triggered later when leaving the view.
* */
*/
function refreshView() {
if (!checkNoChangesMode) {
executeInitHooks(viewData, tView, creationMode);
}
refreshDynamicChildren();
refreshDynamicEmbeddedViews(viewData);
if (!checkNoChangesMode) {
executeHooks(directives !, tView.contentHooks, tView.contentCheckHooks, creationMode);
}
@ -1679,8 +1680,12 @@ export function containerRefreshEnd(): void {
}
}
function refreshDynamicChildren() {
for (let current = getLViewChild(viewData); current !== null; current = current[NEXT]) {
/**
* Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes them
* by executing an associated template function.
*/
function refreshDynamicEmbeddedViews(lViewData: LViewData) {
for (let current = getLViewChild(lViewData); current !== null; current = current[NEXT]) {
// Note: current can be an LViewData or an LContainer instance, but here we are only interested
// in LContainer. We can tell it's an LContainer because its length is less than the LViewData
// header.

View File

@ -195,7 +195,7 @@
"name": "refreshChildComponents"
},
{
"name": "refreshDynamicChildren"
"name": "refreshDynamicEmbeddedViews"
},
{
"name": "refreshView"

View File

@ -468,7 +468,7 @@
"name": "refreshChildComponents"
},
{
"name": "refreshDynamicChildren"
"name": "refreshDynamicEmbeddedViews"
},
{
"name": "refreshView"