Skip to content

Commit

Permalink
feat: use inject in testing class
Browse files Browse the repository at this point in the history
  • Loading branch information
9kubczas4 committed Feb 7, 2023
1 parent 0755f9d commit cb18dc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
@@ -1,5 +1,6 @@
import {
Directive,
inject,
OnInit,
TemplateRef,
ViewContainerRef,
Expand All @@ -9,10 +10,8 @@ import {
selector: '[axLazyElementDynamic]',
})
export class LazyElementDynamicTestingDirective implements OnInit {
constructor(
private vcr: ViewContainerRef,
private template: TemplateRef<any>
) {}
private readonly vcr = inject(ViewContainerRef);
private readonly template = inject(TemplateRef<any>);

ngOnInit() {
this.vcr.createEmbeddedView(this.template);
Expand Down
7 changes: 3 additions & 4 deletions projects/elements/testing/lazy-element-testing.directive.ts
@@ -1,5 +1,6 @@
import {
Directive,
inject,
OnInit,
TemplateRef,
ViewContainerRef,
Expand All @@ -9,10 +10,8 @@ import {
selector: '[axLazyElement]',
})
export class LazyElementTestingDirective implements OnInit {
constructor(
private vcr: ViewContainerRef,
private template: TemplateRef<any>
) {}
private readonly vcr = inject(ViewContainerRef);
private readonly template = inject(TemplateRef<any>);

ngOnInit() {
this.vcr.createEmbeddedView(this.template);
Expand Down

0 comments on commit cb18dc9

Please sign in to comment.