From cb18dc98b7b0d21119e6e1ef427c01e24323d89d Mon Sep 17 00:00:00 2001 From: 9kubczas4 Date: Tue, 7 Feb 2023 16:38:51 +0100 Subject: [PATCH] feat: use inject in testing class --- .../testing/lazy-element-dynamic-testing.directive.ts | 7 +++---- .../elements/testing/lazy-element-testing.directive.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/projects/elements/testing/lazy-element-dynamic-testing.directive.ts b/projects/elements/testing/lazy-element-dynamic-testing.directive.ts index 4f7b239..9de6d4f 100644 --- a/projects/elements/testing/lazy-element-dynamic-testing.directive.ts +++ b/projects/elements/testing/lazy-element-dynamic-testing.directive.ts @@ -1,5 +1,6 @@ import { Directive, + inject, OnInit, TemplateRef, ViewContainerRef, @@ -9,10 +10,8 @@ import { selector: '[axLazyElementDynamic]', }) export class LazyElementDynamicTestingDirective implements OnInit { - constructor( - private vcr: ViewContainerRef, - private template: TemplateRef - ) {} + private readonly vcr = inject(ViewContainerRef); + private readonly template = inject(TemplateRef); ngOnInit() { this.vcr.createEmbeddedView(this.template); diff --git a/projects/elements/testing/lazy-element-testing.directive.ts b/projects/elements/testing/lazy-element-testing.directive.ts index 7b1ba7c..d977022 100644 --- a/projects/elements/testing/lazy-element-testing.directive.ts +++ b/projects/elements/testing/lazy-element-testing.directive.ts @@ -1,5 +1,6 @@ import { Directive, + inject, OnInit, TemplateRef, ViewContainerRef, @@ -9,10 +10,8 @@ import { selector: '[axLazyElement]', }) export class LazyElementTestingDirective implements OnInit { - constructor( - private vcr: ViewContainerRef, - private template: TemplateRef - ) {} + private readonly vcr = inject(ViewContainerRef); + private readonly template = inject(TemplateRef); ngOnInit() { this.vcr.createEmbeddedView(this.template);