99import './ng_dev_mode' ;
1010
1111import { Type } from '../core' ;
12+
1213import { assertEqual , assertLessThan , assertNotEqual , assertNotNull } from './assert' ;
13- import { CssSelector , ContainerState , ProjectionState , QueryState , ViewState } from './interfaces' ;
14- import { LText , LView , LElement , LNode , LNodeFlags , LNodeInjector , LContainer , LProjection } from './l_node' ;
14+ import { ContainerState , CssSelector , ProjectionState , QueryState , ViewState } from './interfaces' ;
15+ import { LContainer , LElement , LNode , LNodeFlags , LNodeInjector , LProjection , LText , LView } from './l_node' ;
16+
1517import { NgStaticData , LNodeStatic , LContainerStatic , InitialInputData , InitialInputs , PropertyAliases , PropertyAliasValue , } from './l_node_static' ;
1618import { assertNodeType } from './node_assert' ;
1719import { appendChild , insertChild , insertView , processProjectedNode , removeView } from './node_manipulation' ;
@@ -129,7 +131,8 @@ export function enterView(newViewState: ViewState, host: LElement | LView | null
129131
130132export const leaveView : ( newViewState : ViewState ) => void = enterView as any ;
131133
132- export function createViewState ( viewId : number , renderer : Renderer3 , ngStaticData : NgStaticData ) : ViewState {
134+ export function createViewState (
135+ viewId : number , renderer : Renderer3 , ngStaticData : NgStaticData ) : ViewState {
133136 const newView = {
134137 parent : currentView ,
135138 id : viewId , // -1 for component views
@@ -336,7 +339,7 @@ export function elementCreate(
336339 } else {
337340 native = renderer . createElement ( name ) ;
338341
339- let componentView : ViewState | null = null ;
342+ let componentView : ViewState | null = null ;
340343 if ( isHostElement ) {
341344 const ngStaticData = getTemplateStatic ( ( nameOrComponentDef as ComponentDef < any > ) . template ) ;
342345 componentView = addToViewTree ( createViewState ( - 1 , renderer , ngStaticData ) ) ;
@@ -402,7 +405,8 @@ export function elementHost(elementOrSelector: RElement | string, def: Component
402405 throw createError ( 'Host node is required:' , elementOrSelector ) ;
403406 }
404407 }
405- createLNode ( 0 , LNodeFlags . Element , rNode , createViewState ( - 1 , renderer , getTemplateStatic ( def . template ) ) ) ;
408+ createLNode (
409+ 0 , LNodeFlags . Element , rNode , createViewState ( - 1 , renderer , getTemplateStatic ( def . template ) ) ) ;
406410}
407411
408412
@@ -454,8 +458,7 @@ export function listenerCreate(
454458function outputCreate ( outputs : ( number | string ) [ ] , listener : Function ) : void {
455459 for ( let i = 0 ; i < outputs . length ; i += 2 ) {
456460 ngDevMode && assertDataInRange ( outputs [ i ] as number ) ;
457- const subscription =
458- data [ outputs [ i ] as number ] [ outputs [ i | 1 ] ] . subscribe ( listener ) ;
461+ const subscription = data [ outputs [ i ] as number ] [ outputs [ i | 1 ] ] . subscribe ( listener ) ;
459462 cleanup ! . push ( subscription . unsubscribe , subscription ) ;
460463 }
461464}
@@ -570,7 +573,8 @@ function setInputsForProperty(inputs: (number | string)[], value: any): void {
570573 *
571574 * @param index Index where data should be stored in ngStaticData
572575 */
573- function generatePropertyAliases ( flags : number , data : LNodeStatic , isInputData = false ) : LNodeStatic {
576+ function generatePropertyAliases (
577+ flags : number , data : LNodeStatic , isInputData = false ) : LNodeStatic {
574578 const start = flags >> LNodeFlags . INDX_SHIFT ;
575579 const size = ( flags & LNodeFlags . SIZE_MASK ) >> LNodeFlags . SIZE_SHIFT ;
576580
@@ -582,7 +586,7 @@ function generatePropertyAliases(flags: number, data: LNodeStatic, isInputData =
582586 if ( propertyAliasMap . hasOwnProperty ( publicName ) ) {
583587 const internalName = propertyAliasMap [ publicName ] ;
584588 const staticDirData : PropertyAliases = isInputData ? ( data . inputs || ( data . inputs = { } ) ) :
585- ( data . outputs || ( data . outputs = { } ) ) ;
589+ ( data . outputs || ( data . outputs = { } ) ) ;
586590 const hasProperty : boolean = staticDirData . hasOwnProperty ( publicName ) ;
587591 hasProperty ? staticDirData [ publicName ] . push ( i , internalName ) :
588592 ( staticDirData [ publicName ] = [ i , internalName ] ) ;
@@ -938,8 +942,8 @@ export function viewCreate(viewBlockId: number): boolean {
938942 const containerState = container . data ;
939943 const views = containerState . views ;
940944
941- const existingView : LView | false = ! creationMode && containerState . nextIndex < views . length &&
942- views [ containerState . nextIndex ] ;
945+ const existingView : LView | false =
946+ ! creationMode && containerState . nextIndex < views . length && views [ containerState . nextIndex ] ;
943947 let viewUpdateMode = existingView && viewBlockId === ( existingView as LView ) . data . id ;
944948
945949 if ( viewUpdateMode ) {
@@ -949,7 +953,8 @@ export function viewCreate(viewBlockId: number): boolean {
949953 enterView ( ( existingView as LView ) . data , previousOrParentNode as LView ) ;
950954 } else {
951955 // When we create a new View, we always reset the state of the instructions.
952- const newViewState = createViewState ( viewBlockId , renderer , initViewStaticData ( viewBlockId , container ) ) ;
956+ const newViewState =
957+ createViewState ( viewBlockId , renderer , initViewStaticData ( viewBlockId , container ) ) ;
953958 enterView ( newViewState , createLNode ( null , LNodeFlags . View , null , newViewState ) ) ;
954959 containerState . nextIndex ++ ;
955960 }
@@ -1571,7 +1576,7 @@ function valueInData<T>(data: any[], index: number, value?: T): T {
15711576 // We don't store any static data for local variables, so the first time
15721577 // we see the template, we should store as null to avoid a sparse array
15731578 if ( index >= ngStaticData . length ) {
1574- ngStaticData [ index ] = null ;
1579+ ngStaticData [ index ] = null ;
15751580 }
15761581 data [ index ] = value ;
15771582 }
@@ -1600,4 +1605,3 @@ function assertDataInRange(index: number, arr?: any[]) {
16001605 if ( arr == null ) arr = data ;
16011606 assertLessThan ( arr ? arr . length : 0 , index , 'data.length' ) ;
16021607}
1603-
0 commit comments