Skip to content

Commit 21cdafb

Browse files
committed
feat: change components to be standalone
1 parent ff276b6 commit 21cdafb

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

projects/ngx-annotate-text/src/lib/components/annotation-renderer/annotation-renderer.component.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ describe('AnnotationRendererComponent', () => {
1212
const getAnnotationParentElement = (): HTMLElement => fixture.nativeElement.querySelector('button.annotation-parent');
1313

1414
beforeEach(async () => {
15-
await TestBed.configureTestingModule({ declarations: [NgxAnnotationRendererComponent] }).compileComponents();
16-
});
15+
await TestBed.configureTestingModule({ imports: [NgxAnnotationRendererComponent] }).compileComponents();
1716

18-
beforeEach(() => {
1917
fixture = TestBed.createComponent(NgxAnnotationRendererComponent);
2018
component = fixture.componentInstance;
2119
component.clickAnnotation = jasmine.createSpy('clickAnnotation');

projects/ngx-annotate-text/src/lib/components/annotation-renderer/annotation-renderer.components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { NgxAnnotationRendererComponentInterface } from '../../models/annotation
77
selector: 'ngx-annotation-renderer',
88
templateUrl: './annotation-renderer.component.html',
99
styleUrls: ['./annotation-renderer.component.css'],
10+
standalone: true,
1011
})
1112
export class NgxAnnotationRendererComponent implements NgxAnnotationRendererComponentInterface {
1213
@Input({ required: true }) annotation!: Annotation;

projects/ngx-annotate-text/src/lib/components/ngx-annotate-text/ngx-annotate-text.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { SimpleChange } from '@angular/core';
32
import { ComponentFixture, TestBed } from '@angular/core/testing';
43
import { Annotation } from '../../models/annotation.model';
@@ -12,7 +11,9 @@ describe('NgxAnnotateTextComponent', () => {
1211
let fixture: ComponentFixture<NgxAnnotateTextComponent>;
1312

1413
beforeEach(async () => {
15-
await TestBed.configureTestingModule({ declarations: [NgxAnnotateTextComponent, NgxAnnotationRendererComponent] });
14+
await TestBed.configureTestingModule({
15+
imports: [NgxAnnotateTextComponent, NgxAnnotationRendererComponent],
16+
}).compileComponents();
1617

1718
fixture = TestBed.createComponent(NgxAnnotateTextComponent);
1819
component = fixture.componentInstance;

projects/ngx-annotate-text/src/lib/components/ngx-annotate-text/ngx-annotate-text.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ import { ISelection } from '../../models/selection.model';
1414
import { TokenizerService } from '../../services/tokenizer.service';
1515
import { NgxAnnotationRendererComponent } from '../annotation-renderer/annotation-renderer.components';
1616
import { NgxAnnotationRendererComponentInterface } from '../../models/annotation-renderer-component.model';
17+
import { NgComponentOutlet } from '@angular/common';
1718

1819
@Component({
1920
// eslint-disable-next-line @angular-eslint/component-selector
2021
selector: 'ngx-annotate-text',
2122
templateUrl: './ngx-annotate-text.component.html',
2223
styleUrls: ['./ngx-annotate-text.component.css'],
24+
imports: [NgComponentOutlet],
25+
standalone: true,
2326
})
2427
export class NgxAnnotateTextComponent implements OnInit, OnChanges {
2528
/** Represents the parts of the given text which shall be annotated. */

projects/ngx-annotate-text/src/lib/ngx-annotate-text.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { NgxAnnotationRendererComponent } from './components/annotation-renderer
44
import { NgxAnnotateTextComponent } from './components/ngx-annotate-text/ngx-annotate-text.component';
55

66
@NgModule({
7-
declarations: [NgxAnnotationRendererComponent, NgxAnnotateTextComponent],
8-
imports: [CommonModule, NgComponentOutlet],
9-
exports: [NgxAnnotateTextComponent, NgxAnnotationRendererComponent],
7+
declarations: [],
8+
imports: [CommonModule, NgComponentOutlet, NgxAnnotationRendererComponent, NgxAnnotateTextComponent],
9+
exports: [NgxAnnotationRendererComponent, NgxAnnotateTextComponent],
1010
})
1111
export class NgxAnnotateTextModule {}

0 commit comments

Comments
 (0)