MCPcopy Create free account
hub / github.com/angular/angular / Dir

Class Dir

packages/core/test/render3/reactivity_spec.ts:414–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412 const source = signal('');
413
414 @Directive({
415 selector: '[dir]',
416 })
417 class Dir {
418 tpl = inject(TemplateRef);
419 vcr = inject(ViewContainerRef);
420 cdr = inject(ChangeDetectorRef);
421 ctx = {
422 $implicit: '',
423 };
424 ref = this.vcr.createEmbeddedView(this.tpl, this.ctx);
425
426 effectRef = effect(() => {
427 if (this.ctx.$implicit !== source()) {
428 this.ctx.$implicit = source();
429 this.cdr.markForCheck();
430 }
431 });
432 }
433
434 @Component({
435 imports: [Dir],

Callers

nothing calls this directly

Calls 6

DirectiveClass · 0.90
injectFunction · 0.90
effectFunction · 0.90
sourceFunction · 0.85
markForCheckMethod · 0.80
createEmbeddedViewMethod · 0.65

Tested by

no test coverage detected