@@ -22,7 +22,7 @@ import {isViewDebugError, viewDestroyedError, viewWrappedDebugError} from './err
22
22
import { resolveDep } from './provider' ;
23
23
import { dirtyParentQueries , getQueryValue } from './query' ;
24
24
import { createInjector , createNgModuleRef , getComponentViewDefinitionFactory } from './refs' ;
25
- import { ArgumentType , BindingFlags , CheckType , DebugContext , DepDef , ElementData , NgModuleDefinition , NgModuleProviderDef , NodeDef , NodeFlags , NodeLogger , ProviderOverride , RootData , Services , ViewData , ViewDefinition , ViewState , asElementData , asPureExpressionData } from './types' ;
25
+ import { ArgumentType , BindingFlags , CheckType , DebugContext , ElementData , NgModuleDefinition , NodeDef , NodeFlags , NodeLogger , ProviderOverride , RootData , Services , ViewData , ViewDefinition , ViewState , asElementData , asPureExpressionData } from './types' ;
26
26
import { NOOP , isComponentView , renderNode , resolveDefinition , splitDepsDsl , viewParentEl } from './util' ;
27
27
import { checkAndUpdateNode , checkAndUpdateView , checkNoChangesNode , checkNoChangesView , createComponentView , createEmbeddedView , createRootView , destroyView } from './view' ;
28
28
@@ -509,6 +509,7 @@ class DebugContext_ implements DebugContext {
509
509
private nodeDef : NodeDef ;
510
510
private elView : ViewData ;
511
511
private elDef : NodeDef ;
512
+
512
513
constructor ( public view : ViewData , public nodeIndex : number | null ) {
513
514
if ( nodeIndex == null ) {
514
515
this . nodeIndex = nodeIndex = 0 ;
@@ -528,13 +529,18 @@ class DebugContext_ implements DebugContext {
528
529
this . elDef = elDef ;
529
530
this . elView = elView ;
530
531
}
532
+
531
533
private get elOrCompView ( ) {
532
534
// Has to be done lazily as we use the DebugContext also during creation of elements...
533
535
return asElementData ( this . elView , this . elDef . nodeIndex ) . componentView || this . view ;
534
536
}
537
+
535
538
get injector ( ) : Injector { return createInjector ( this . elView , this . elDef ) ; }
539
+
536
540
get component ( ) : any { return this . elOrCompView . component ; }
541
+
537
542
get context ( ) : any { return this . elOrCompView . context ; }
543
+
538
544
get providerTokens ( ) : any [ ] {
539
545
const tokens : any [ ] = [ ] ;
540
546
if ( this . elDef ) {
@@ -549,6 +555,7 @@ class DebugContext_ implements DebugContext {
549
555
}
550
556
return tokens ;
551
557
}
558
+
552
559
get references ( ) : { [ key : string ] : any } {
553
560
const references : { [ key : string ] : any } = { } ;
554
561
if ( this . elDef ) {
@@ -565,14 +572,17 @@ class DebugContext_ implements DebugContext {
565
572
}
566
573
return references ;
567
574
}
575
+
568
576
get componentRenderElement ( ) {
569
577
const elData = findHostElement ( this . elOrCompView ) ;
570
578
return elData ? elData . renderElement : undefined ;
571
579
}
580
+
572
581
get renderNode ( ) : any {
573
582
return this . nodeDef . flags & NodeFlags . TypeText ? renderNode ( this . view , this . nodeDef ) :
574
583
renderNode ( this . elView , this . elDef ) ;
575
584
}
585
+
576
586
logError ( console : Console , ...values : any [ ] ) {
577
587
let logViewDef : ViewDefinition ;
578
588
let logNodeIndex : number ;
0 commit comments