@@ -253,10 +253,9 @@ export function createNodeAtIndex(
253
253
const lView = getLView ( ) ;
254
254
const tView = lView [ TVIEW ] ;
255
255
const adjustedIndex = index + HEADER_OFFSET ;
256
-
257
- const previousOrParentTNode = getPreviousOrParentTNode ( ) ;
258
256
let tNode = tView . data [ adjustedIndex ] as TNode ;
259
257
if ( tNode == null ) {
258
+ const previousOrParentTNode = getPreviousOrParentTNode ( ) ;
260
259
const isParent = getIsParent ( ) ;
261
260
const parent =
262
261
isParent ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode . parent ;
@@ -369,7 +368,8 @@ export function createEmbeddedViewAndNode<T>(
369
368
*
370
369
* Dynamically created views must store/retrieve their TViews differently from component views
371
370
* because their template functions are nested in the template functions of their hosts, creating
372
- * closures. If their host template happens to be an embedded template in a loop (e.g. ngFor inside
371
+ * closures. If their host template happens to be an embedded template in a loop (e.g. ngFor
372
+ * inside
373
373
* an ngFor), the nesting would mean we'd have multiple instances of the template function, so we
374
374
* can't store TViews in the template function itself (as we do for comps). Instead, we store the
375
375
* TView for dynamically created views on their host TNode, which only has one instance.
@@ -811,7 +811,8 @@ export function elementPropertyInternal<T>(
811
811
savePropertyDebugData ( tNode , lView , propName , lView [ TVIEW ] . data , nativeOnly ) ;
812
812
813
813
const renderer = loadRendererFn ? loadRendererFn ( tNode , lView ) : lView [ RENDERER ] ;
814
- // It is assumed that the sanitizer is only added when the compiler determines that the property
814
+ // It is assumed that the sanitizer is only added when the compiler determines that the
815
+ // property
815
816
// is risky, so sanitization can be done without further checks.
816
817
value = sanitizer != null ? ( sanitizer ( value , tNode . tagName || '' , propName ) as any ) : value ;
817
818
if ( isProceduralRenderer ( renderer ) ) {
@@ -957,7 +958,8 @@ export function instantiateRootComponent<T>(
957
958
function resolveDirectives (
958
959
tView : TView , viewData : LView , directives : DirectiveDef < any > [ ] | null , tNode : TNode ,
959
960
localRefs : string [ ] | null ) : void {
960
- // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.
961
+ // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in
962
+ // tsickle.
961
963
ngDevMode && assertEqual ( tView . firstTemplatePass , true , 'should run on first template pass only' ) ;
962
964
const exportsMap : ( { [ key : string ] : number } | null ) = localRefs ? { '' : - 1 } : null ;
963
965
if ( directives ) {
@@ -1383,7 +1385,8 @@ export function createLContainer(
1383
1385
1384
1386
1385
1387
/**
1386
- * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes them
1388
+ * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes
1389
+ * them
1387
1390
* by executing an associated template function.
1388
1391
*/
1389
1392
function refreshDynamicEmbeddedViews ( lView : LView ) {
@@ -1394,7 +1397,8 @@ function refreshDynamicEmbeddedViews(lView: LView) {
1394
1397
if ( current [ ACTIVE_INDEX ] === - 1 && isLContainer ( current ) ) {
1395
1398
for ( let i = CONTAINER_HEADER_OFFSET ; i < current . length ; i ++ ) {
1396
1399
const dynamicViewData = current [ i ] ;
1397
- // The directives and pipes are not needed here as an existing view is only being refreshed.
1400
+ // The directives and pipes are not needed here as an existing view is only being
1401
+ // refreshed.
1398
1402
ngDevMode && assertDefined ( dynamicViewData [ TVIEW ] , 'TView must be allocated' ) ;
1399
1403
renderEmbeddedTemplate ( dynamicViewData , dynamicViewData [ TVIEW ] , dynamicViewData [ CONTEXT ] ! ) ;
1400
1404
}
@@ -1471,9 +1475,12 @@ function syncViewWithBlueprint(componentView: LView) {
1471
1475
* @returns The state passed in
1472
1476
*/
1473
1477
export function addToViewTree < T extends LView | LContainer > ( lView : LView , lViewOrLContainer : T ) : T {
1474
- // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer to
1475
- // the end of the queue, which means if the developer retrieves the LContainers from RNodes out of
1476
- // order, the change detection will run out of order, as the act of retrieving the the LContainer
1478
+ // TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer
1479
+ // to
1480
+ // the end of the queue, which means if the developer retrieves the LContainers from RNodes out
1481
+ // of
1482
+ // order, the change detection will run out of order, as the act of retrieving the the
1483
+ // LContainer
1477
1484
// from the RNode is what adds it to the queue.
1478
1485
if ( lView [ CHILD_HEAD ] ) {
1479
1486
lView [ CHILD_TAIL ] ! [ NEXT ] = lViewOrLContainer ;
@@ -1626,7 +1633,8 @@ export function checkNoChangesInRootView(lView: LView): void {
1626
1633
}
1627
1634
}
1628
1635
1629
- /** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */
1636
+ /** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck.
1637
+ */
1630
1638
export function checkView < T > ( hostView : LView , component : T ) {
1631
1639
const hostTView = hostView [ TVIEW ] ;
1632
1640
const oldView = enterView ( hostView , hostView [ T_HOST ] ) ;
0 commit comments