Skip to content

Commit 1d8e050

Browse files
committed
Set standalone components to false in test files testing for modules.
In Angular19, components are standalone by default. Added lint suppressions since it now complains about using non-standalone components...
1 parent 7bae634 commit 1d8e050

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

projects/ngx-translate/src/lib/translate.directive-module.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ import {ChangeDetectionStrategy, Component, ElementRef, Injectable, ViewChild, V
22
import {ComponentFixture, TestBed} from '@angular/core/testing';
33
import {TranslateModule, TranslateService} from "../public-api";
44

5+
56
@Injectable()
67
@Component({
8+
// eslint-disable-next-line @angular-eslint/prefer-standalone
9+
standalone: false,
710
selector: 'lib-hmx-app',
811
changeDetection: ChangeDetectionStrategy.OnPush,
912
template: `

projects/ngx-translate/src/lib/translate.directive-standalone.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import {ChangeDetectionStrategy, Component, ElementRef, Injectable, ViewChild, ViewContainerRef} from '@angular/core';
22
import {ComponentFixture, TestBed} from '@angular/core/testing';
3-
import {
4-
provideTranslateService, TranslateDirective, TranslatePipe,
5-
TranslateService
6-
} from "../public-api";
3+
import {provideTranslateService, TranslateDirective, TranslateService} from "../public-api";
74

85
@Injectable()
96
@Component({
107
selector: 'lib-hmx-app',
118
standalone: true,
12-
imports: [TranslateDirective, TranslatePipe],
9+
imports: [TranslateDirective],
1310
changeDetection: ChangeDetectionStrategy.OnPush,
1411
template: `
1512
<div #noKey translate>TEST</div>

projects/ngx-translate/src/lib/translate.pipe-modules.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class FakeChangeDetectorRef extends ChangeDetectorRef {
3535

3636
@Injectable()
3737
@Component({
38+
// eslint-disable-next-line @angular-eslint/prefer-standalone
39+
standalone: false,
3840
selector: 'lib-hmx-app',
3941
changeDetection: ChangeDetectionStrategy.OnPush,
4042
template: `{{'TEST' | translate}}`

projects/ngx-translate/src/lib/translate.store.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {provideRouter, Router, RouterModule} from "@angular/router";
55
import {TranslateModule, TranslateService} from"../public-api";
66

77
@Component({
8+
// eslint-disable-next-line @angular-eslint/prefer-standalone
9+
standalone: false,
810
selector: 'lib-root-cmp',
911
template: `
1012
<router-outlet></router-outlet>`
@@ -20,14 +22,17 @@ class RootComponent {
2022
}
2123

2224
@Component({
25+
// eslint-disable-next-line @angular-eslint/prefer-standalone
26+
standalone: false,
2327
selector: 'lib-lazy',
2428
template: 'lazy-loaded-parent [<router-outlet></router-outlet>]'
2529
})
2630
class ParentLazyLoadedComponent {
2731
}
2832

2933
function getLazyLoadedModule<T extends object>(importedModule: ModuleWithProviders<T>) {
30-
@Component({selector: 'lib-lazy', template: 'lazy-loaded-child'})
34+
// eslint-disable-next-line @angular-eslint/prefer-standalone
35+
@Component({selector: 'lib-lazy', template: 'lazy-loaded-child', standalone: false})
3136
class ChildLazyLoadedComponent {
3237
constructor(public translate: TranslateService) {
3338
translate.setTranslation('en', {

0 commit comments

Comments
 (0)