File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 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';
5151export class NgtCanvasContent {
5252 private canvas = inject ( NgtCanvasImpl ) ;
5353
54- get host ( ) {
55- return this . canvas [ 'host' ] . nativeElement ;
56- }
57-
5854 constructor ( ) {
5955 const store = injectStore ( ) ;
6056 const vcr = inject ( ViewContainerRef ) ;
@@ -64,6 +60,13 @@ export class NgtCanvasContent {
6460 commentNode . data = NGT_CANVAS_CONTENT_FLAG ;
6561 commentNode [ NGT_CANVAS_CONTENT_FLAG ] = store ;
6662 }
63+
64+ static ngTemplateContextGuard (
65+ _ : NgtCanvasContent ,
66+ ctx : unknown ,
67+ ) : ctx is { $implicit : HTMLCanvasElement ; host : HTMLElement } {
68+ return true ;
69+ }
6770}
6871
6972@Component ( {
@@ -246,7 +249,11 @@ export class NgtCanvasImpl {
246249 this . store . snapshot . events . connect ?.( canvasElement ) ;
247250 }
248251
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+ ) ;
250257 this . glRef . detectChanges ( ) ;
251258 }
252259}
You can’t perform that action at this time.
0 commit comments