File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,6 @@ import { createPointerEvents } from './events';
51
51
export class NgtCanvasContent {
52
52
private canvas = inject ( NgtCanvasImpl ) ;
53
53
54
- get host ( ) {
55
- return this . canvas [ 'host' ] . nativeElement ;
56
- }
57
-
58
54
constructor ( ) {
59
55
const store = injectStore ( ) ;
60
56
const vcr = inject ( ViewContainerRef ) ;
@@ -64,6 +60,13 @@ export class NgtCanvasContent {
64
60
commentNode . data = NGT_CANVAS_CONTENT_FLAG ;
65
61
commentNode [ NGT_CANVAS_CONTENT_FLAG ] = store ;
66
62
}
63
+
64
+ static ngTemplateContextGuard (
65
+ _ : NgtCanvasContent ,
66
+ ctx : unknown ,
67
+ ) : ctx is { $implicit : HTMLCanvasElement ; host : HTMLElement } {
68
+ return true ;
69
+ }
67
70
}
68
71
69
72
@Component ( {
@@ -246,7 +249,11 @@ export class NgtCanvasImpl {
246
249
this . store . snapshot . events . connect ?.( canvasElement ) ;
247
250
}
248
251
249
- this . glRef = canvasVcr . createEmbeddedView ( canvasContent , { } , { injector : this . injector } ) ;
252
+ this . glRef = canvasVcr . createEmbeddedView (
253
+ canvasContent ,
254
+ { $implicit : canvasElement , host : this . host . nativeElement } ,
255
+ { injector : this . injector } ,
256
+ ) ;
250
257
this . glRef . detectChanges ( ) ;
251
258
}
252
259
}
You can’t perform that action at this time.
0 commit comments