Skip to content

Commit 61df38d

Browse files
committed
fix ci
1 parent da358fc commit 61df38d

32 files changed

+110
-127
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// @ts-check
22

3-
import tseslint from "typescript-eslint";
4-
import rootConfig from "../../eslint.config.mjs";
3+
import tseslint from 'typescript-eslint';
4+
import rootConfig from '../../eslint.config.mjs';
55

6-
export default tseslint.config(
7-
...rootConfig,
8-
);
6+
export default tseslint.config(...rootConfig);

apps/example-app-karma/src/app/examples/login-form.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { Component, inject } from '@angular/core';
22
import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
33
import userEvent from '@testing-library/user-event';
44
import { render, screen } from '@testing-library/angular';
@@ -45,13 +45,13 @@ it('should display invalid message and submit button must be disabled', async ()
4545
`,
4646
})
4747
class LoginComponent {
48+
private fb = inject(FormBuilder);
49+
4850
form: FormGroup = this.fb.group({
4951
email: ['', [Validators.required, Validators.email]],
5052
password: ['', [Validators.required, Validators.minLength(8)]],
5153
});
5254

53-
constructor(private fb: FormBuilder) {}
54-
5555
get email(): FormControl {
5656
return this.form.get('email') as FormControl;
5757
}

apps/example-app-karma/src/app/issues/issue-491.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { Component, inject } from '@angular/core';
22
import { Router } from '@angular/router';
33
import { render, screen } from '@testing-library/angular';
44
import userEvent from '@testing-library/user-event';
@@ -43,7 +43,7 @@ it('test click event with router.navigate', async () => {
4343
`,
4444
})
4545
class LoginComponent {
46-
constructor(private router: Router) {}
46+
private readonly router = inject(Router);
4747
onSubmit(): void {
4848
this.router.navigate(['logged-in']);
4949
}

apps/example-app/eslint.config.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// @ts-check
22

3-
import tseslint from "typescript-eslint";
4-
import rootConfig from "../../eslint.config.mjs";
3+
import tseslint from 'typescript-eslint';
4+
import rootConfig from '../../eslint.config.mjs';
55

6-
export default tseslint.config(
7-
...rootConfig,
8-
);
6+
export default tseslint.config(...rootConfig);

apps/example-app/src/app/examples/03-forms.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NgForOf, NgIf } from '@angular/common';
2-
import { Component } from '@angular/core';
2+
import { Component, inject } from '@angular/core';
33
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
44

55
@Component({
@@ -33,6 +33,8 @@ import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
3333
`,
3434
})
3535
export class FormsComponent {
36+
private formBuilder = inject(FormBuilder);
37+
3638
colors = [
3739
{ id: 'R', value: 'Red' },
3840
{ id: 'B', value: 'Blue' },
@@ -45,8 +47,6 @@ export class FormsComponent {
4547
color: [null as string | null, Validators.required],
4648
});
4749

48-
constructor(private formBuilder: FormBuilder) {}
49-
5050
get formErrors() {
5151
return Object.keys(this.form.controls)
5252
.map((formKey) => {

apps/example-app/src/app/examples/04-forms-with-material.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { Component, inject } from '@angular/core';
22
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
33
import { NgForOf, NgIf } from '@angular/common';
44
import { MatCheckboxModule } from '@angular/material/checkbox';
@@ -84,6 +84,8 @@ import { MatNativeDateModule } from '@angular/material/core';
8484
],
8585
})
8686
export class MaterialFormsComponent {
87+
private formBuilder = inject(FormBuilder);
88+
8789
colors = [
8890
{ id: 'R', value: 'Red' },
8991
{ id: 'B', value: 'Blue' },
@@ -97,8 +99,6 @@ export class MaterialFormsComponent {
9799
agree: [false, Validators.requiredTrue],
98100
});
99101

100-
constructor(private formBuilder: FormBuilder) {}
101-
102102
get colorControlDisplayValue(): string | undefined {
103103
const selectedId = this.form.get('color')?.value;
104104
return this.colors.filter((color) => color.id === selectedId)[0]?.value;

apps/example-app/src/app/examples/05-component-provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Injectable } from '@angular/core';
1+
import { Component, inject, Injectable } from '@angular/core';
22

33
@Injectable({
44
providedIn: 'root',
@@ -30,5 +30,5 @@ export class CounterService {
3030
providers: [CounterService],
3131
})
3232
export class ComponentWithProviderComponent {
33-
constructor(public counter: CounterService) {}
33+
protected counter = inject(CounterService);
3434
}

apps/example-app/src/app/examples/06-with-ngrx-store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AsyncPipe } from '@angular/common';
2-
import { Component } from '@angular/core';
2+
import { Component, inject } from '@angular/core';
33
import { createSelector, Store, createAction, createReducer, on, select } from '@ngrx/store';
44

55
const increment = createAction('increment');
@@ -26,8 +26,9 @@ const selectValue = createSelector(
2626
`,
2727
})
2828
export class WithNgRxStoreComponent {
29+
private store = inject(Store);
30+
2931
value = this.store.pipe(select(selectValue));
30-
constructor(private store: Store<any>) {}
3132

3233
increment() {
3334
this.store.dispatch(increment());

apps/example-app/src/app/examples/07-with-ngrx-mock-store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AsyncPipe, NgForOf } from '@angular/common';
2-
import { Component } from '@angular/core';
2+
import { Component, inject } from '@angular/core';
33
import { createSelector, Store, select } from '@ngrx/store';
44

55
export const selectItems = createSelector(
@@ -20,8 +20,9 @@ export const selectItems = createSelector(
2020
`,
2121
})
2222
export class WithNgRxMockStoreComponent {
23+
private store = inject(Store);
24+
2325
items = this.store.pipe(select(selectItems));
24-
constructor(private store: Store<any>) {}
2526

2627
send(item: string) {
2728
this.store.dispatch({ type: '[Item List] send', item });

apps/example-app/src/app/examples/08-directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Directive, HostListener, ElementRef, Input, OnInit } from '@angular/core';
1+
import { Directive, HostListener, ElementRef, Input, OnInit, inject } from '@angular/core';
22

33
@Directive({
44
standalone: true,
55
selector: '[atlSpoiler]',
66
})
77
export class SpoilerDirective implements OnInit {
8+
private el = inject(ElementRef);
9+
810
@Input() hidden = 'SPOILER';
911
@Input() visible = 'I am visible now...';
1012

11-
constructor(private el: ElementRef) {}
12-
1313
ngOnInit() {
1414
this.el.nativeElement.textContent = this.hidden;
1515
}

0 commit comments

Comments
 (0)