diff --git a/apps/angular/1-projection/src/app/app.component.ts b/apps/angular/1-projection/src/app/app.component.ts index df654bbc2..a8b7ab73b 100644 --- a/apps/angular/1-projection/src/app/app.component.ts +++ b/apps/angular/1-projection/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { CityCardComponent } from './component/city-card/city-card.component'; import { StudentCardComponent } from './component/student-card/student-card.component'; import { TeacherCardComponent } from './component/teacher-card/teacher-card.component'; @@ -12,6 +12,7 @@ import { TeacherCardComponent } from './component/teacher-card/teacher-card.comp `, + changeDetection: ChangeDetectionStrategy.Eager, imports: [TeacherCardComponent, StudentCardComponent, CityCardComponent], }) export class AppComponent {} diff --git a/apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts b/apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts index adf0ad3c1..3e454ac19 100644 --- a/apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts +++ b/apps/angular/1-projection/src/app/component/teacher-card/teacher-card.component.ts @@ -1,4 +1,9 @@ -import { Component, inject, OnInit } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + OnInit, +} from '@angular/core'; import { FakeHttpService } from '../../data-access/fake-http.service'; import { TeacherStore } from '../../data-access/teacher.store'; import { CardType } from '../../model/card.model'; @@ -19,6 +24,7 @@ import { CardComponent } from '../../ui/card/card.component'; } `, ], + changeDetection: ChangeDetectionStrategy.Eager, imports: [CardComponent], }) export class TeacherCardComponent implements OnInit { diff --git a/apps/angular/1-projection/src/app/ui/card/card.component.ts b/apps/angular/1-projection/src/app/ui/card/card.component.ts index 166d9c49a..d395474e2 100644 --- a/apps/angular/1-projection/src/app/ui/card/card.component.ts +++ b/apps/angular/1-projection/src/app/ui/card/card.component.ts @@ -1,5 +1,10 @@ import { NgOptimizedImage } from '@angular/common'; -import { Component, inject, input } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + input, +} from '@angular/core'; import { randStudent, randTeacher } from '../../data-access/fake-http.service'; import { StudentStore } from '../../data-access/student.store'; import { TeacherStore } from '../../data-access/teacher.store'; @@ -35,6 +40,7 @@ import { ListItemComponent } from '../list-item/list-item.component'; `, + changeDetection: ChangeDetectionStrategy.Eager, imports: [ListItemComponent, NgOptimizedImage], }) export class CardComponent { diff --git a/apps/angular/1-projection/tsconfig.app.json b/apps/angular/1-projection/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/1-projection/tsconfig.app.json +++ b/apps/angular/1-projection/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/10-utility-wrapper-pipe/src/app/app.component.ts b/apps/angular/10-utility-wrapper-pipe/src/app/app.component.ts index 9a8156a5f..f4c8cac3c 100644 --- a/apps/angular/10-utility-wrapper-pipe/src/app/app.component.ts +++ b/apps/angular/10-utility-wrapper-pipe/src/app/app.component.ts @@ -1,8 +1,9 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { PersonUtils } from './person.utils'; @Component({ selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` @for (activity of activities; track activity.name) { {{ activity.name }} : diff --git a/apps/angular/10-utility-wrapper-pipe/tsconfig.app.json b/apps/angular/10-utility-wrapper-pipe/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/10-utility-wrapper-pipe/tsconfig.app.json +++ b/apps/angular/10-utility-wrapper-pipe/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/13-highly-customizable-css/src/app/page.component.ts b/apps/angular/13-highly-customizable-css/src/app/page.component.ts index 029ca52d2..23432d46c 100644 --- a/apps/angular/13-highly-customizable-css/src/app/page.component.ts +++ b/apps/angular/13-highly-customizable-css/src/app/page.component.ts @@ -1,11 +1,12 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { TextStaticComponent } from './static-text.component'; import { TextComponent } from './text.component'; @Component({ selector: 'page', imports: [TextStaticComponent, TextComponent], + changeDetection: ChangeDetectionStrategy.Eager, template: ` diff --git a/apps/angular/13-highly-customizable-css/src/app/static-text.component.ts b/apps/angular/13-highly-customizable-css/src/app/static-text.component.ts index 703e2a538..f677ab72c 100644 --- a/apps/angular/13-highly-customizable-css/src/app/static-text.component.ts +++ b/apps/angular/13-highly-customizable-css/src/app/static-text.component.ts @@ -1,5 +1,10 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component, computed, input } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + computed, + input, +} from '@angular/core'; import { TextComponent } from './text.component'; export type StaticTextType = 'normal' | 'warning' | 'error'; @@ -7,6 +12,7 @@ export type StaticTextType = 'normal' | 'warning' | 'error'; @Component({ selector: 'static-text', imports: [TextComponent], + changeDetection: ChangeDetectionStrategy.Eager, template: ` This is a static text `, diff --git a/apps/angular/13-highly-customizable-css/src/app/text.component.ts b/apps/angular/13-highly-customizable-css/src/app/text.component.ts index 9682c6b87..afd4d4c14 100644 --- a/apps/angular/13-highly-customizable-css/src/app/text.component.ts +++ b/apps/angular/13-highly-customizable-css/src/app/text.component.ts @@ -1,8 +1,9 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @Component({ selector: 'text', + changeDetection: ChangeDetectionStrategy.Eager, template: `

diff --git a/apps/angular/13-highly-customizable-css/tsconfig.app.json b/apps/angular/13-highly-customizable-css/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/13-highly-customizable-css/tsconfig.app.json +++ b/apps/angular/13-highly-customizable-css/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/16-master-dependency-injection/tsconfig.app.json b/apps/angular/16-master-dependency-injection/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/16-master-dependency-injection/tsconfig.app.json +++ b/apps/angular/16-master-dependency-injection/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/21-anchor-navigation/src/app/app.component.ts b/apps/angular/21-anchor-navigation/src/app/app.component.ts index 5caca0271..62f274d07 100644 --- a/apps/angular/21-anchor-navigation/src/app/app.component.ts +++ b/apps/angular/21-anchor-navigation/src/app/app.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ imports: [RouterOutlet], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` `, diff --git a/apps/angular/21-anchor-navigation/src/app/foo.component.ts b/apps/angular/21-anchor-navigation/src/app/foo.component.ts index 6744c3662..0438dd26c 100644 --- a/apps/angular/21-anchor-navigation/src/app/foo.component.ts +++ b/apps/angular/21-anchor-navigation/src/app/foo.component.ts @@ -1,12 +1,13 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { NavButtonComponent } from './nav-button.component'; @Component({ imports: [NavButtonComponent], selector: 'app-foo', + changeDetection: ChangeDetectionStrategy.Eager, template: ` Welcome to foo page - Home Page + Home Page

section 1
section 2
`, diff --git a/apps/angular/21-anchor-navigation/src/app/home.component.ts b/apps/angular/21-anchor-navigation/src/app/home.component.ts index 6ef9bc2b6..522b2af6d 100644 --- a/apps/angular/21-anchor-navigation/src/app/home.component.ts +++ b/apps/angular/21-anchor-navigation/src/app/home.component.ts @@ -1,11 +1,12 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { NavButtonComponent } from './nav-button.component'; @Component({ imports: [NavButtonComponent], selector: 'app-home', + changeDetection: ChangeDetectionStrategy.Eager, template: ` - Foo Page + Foo Page
Empty Scroll Bottom diff --git a/apps/angular/21-anchor-navigation/src/app/nav-button.component.ts b/apps/angular/21-anchor-navigation/src/app/nav-button.component.ts index 7a22c7f38..329239f88 100644 --- a/apps/angular/21-anchor-navigation/src/app/nav-button.component.ts +++ b/apps/angular/21-anchor-navigation/src/app/nav-button.component.ts @@ -1,5 +1,5 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @Component({ selector: 'nav-button', @@ -8,6 +8,7 @@ import { Component, input } from '@angular/core'; `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'block w-fit border border-red-500 rounded-md p-4 m-2', }, diff --git a/apps/angular/21-anchor-navigation/tsconfig.app.json b/apps/angular/21-anchor-navigation/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/21-anchor-navigation/tsconfig.app.json +++ b/apps/angular/21-anchor-navigation/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/22-router-input/src/app/app.component.ts b/apps/angular/22-router-input/src/app/app.component.ts index 9dfc11200..b9fa3e158 100644 --- a/apps/angular/22-router-input/src/app/app.component.ts +++ b/apps/angular/22-router-input/src/app/app.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { RouterLink, RouterModule } from '@angular/router'; @Component({ imports: [RouterLink, RouterModule, ReactiveFormsModule], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` diff --git a/apps/angular/22-router-input/src/app/home.component.ts b/apps/angular/22-router-input/src/app/home.component.ts index 0ddc1501d..fddc99344 100644 --- a/apps/angular/22-router-input/src/app/home.component.ts +++ b/apps/angular/22-router-input/src/app/home.component.ts @@ -1,7 +1,8 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-home', imports: [], + changeDetection: ChangeDetectionStrategy.Eager, template: `
Home
`, diff --git a/apps/angular/22-router-input/src/app/test.component.ts b/apps/angular/22-router-input/src/app/test.component.ts index 747ab4483..699321ec5 100644 --- a/apps/angular/22-router-input/src/app/test.component.ts +++ b/apps/angular/22-router-input/src/app/test.component.ts @@ -1,11 +1,12 @@ import { AsyncPipe } from '@angular/common'; -import { Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { map } from 'rxjs'; @Component({ selector: 'app-subscription', imports: [AsyncPipe], + changeDetection: ChangeDetectionStrategy.Eager, template: `
TestId: {{ testId$ | async }}
Permission: {{ permission$ | async }}
diff --git a/apps/angular/22-router-input/tsconfig.app.json b/apps/angular/22-router-input/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/22-router-input/tsconfig.app.json +++ b/apps/angular/22-router-input/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/31-module-to-standalone/src/app/app.component.ts b/apps/angular/31-module-to-standalone/src/app/app.component.ts index 986df84b5..db801daf1 100644 --- a/apps/angular/31-module-to-standalone/src/app/app.component.ts +++ b/apps/angular/31-module-to-standalone/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-root', @@ -25,6 +25,7 @@ import { Component } from '@angular/core'; host: { class: 'flex flex-col p-4 gap-3', }, + changeDetection: ChangeDetectionStrategy.Eager, standalone: false, }) export class AppComponent {} diff --git a/apps/angular/31-module-to-standalone/tsconfig.app.json b/apps/angular/31-module-to-standalone/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/31-module-to-standalone/tsconfig.app.json +++ b/apps/angular/31-module-to-standalone/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/32-change-detection-bug/src/app/app.component.ts b/apps/angular/32-change-detection-bug/src/app/app.component.ts index 217999c3a..ef7a5c2c0 100644 --- a/apps/angular/32-change-detection-bug/src/app/app.component.ts +++ b/apps/angular/32-change-detection-bug/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ @@ -13,6 +13,7 @@ import { RouterOutlet } from '@angular/router';
`, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex flex-col gap-2', }, diff --git a/apps/angular/32-change-detection-bug/src/app/bar.component.ts b/apps/angular/32-change-detection-bug/src/app/bar.component.ts index 81981f99d..74aa71e07 100644 --- a/apps/angular/32-change-detection-bug/src/app/bar.component.ts +++ b/apps/angular/32-change-detection-bug/src/app/bar.component.ts @@ -1,7 +1,8 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-bar', + changeDetection: ChangeDetectionStrategy.Eager, template: ` BarComponent `, diff --git a/apps/angular/32-change-detection-bug/src/app/foo.component.ts b/apps/angular/32-change-detection-bug/src/app/foo.component.ts index 1fcb24326..d5535d0e6 100644 --- a/apps/angular/32-change-detection-bug/src/app/foo.component.ts +++ b/apps/angular/32-change-detection-bug/src/app/foo.component.ts @@ -1,7 +1,8 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-foo', + changeDetection: ChangeDetectionStrategy.Eager, template: ` Foo Component `, diff --git a/apps/angular/32-change-detection-bug/src/app/main-navigation.component.ts b/apps/angular/32-change-detection-bug/src/app/main-navigation.component.ts index 411127672..f99a4b1d0 100644 --- a/apps/angular/32-change-detection-bug/src/app/main-navigation.component.ts +++ b/apps/angular/32-change-detection-bug/src/app/main-navigation.component.ts @@ -1,4 +1,9 @@ -import { Component, inject, input } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + input, +} from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { RouterLink, RouterLinkActive } from '@angular/router'; import { FakeServiceService } from './fake.service'; @@ -27,6 +32,7 @@ interface MenuItem { @apply bg-gray-600 text-white; } `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex flex-col p-2 gap-2', }, @@ -44,6 +50,7 @@ export class NavigationComponent { } `, + changeDetection: ChangeDetectionStrategy.Eager, host: {}, }) export class MainNavigationComponent { diff --git a/apps/angular/32-change-detection-bug/tsconfig.app.json b/apps/angular/32-change-detection-bug/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/32-change-detection-bug/tsconfig.app.json +++ b/apps/angular/32-change-detection-bug/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/33-decoupling-components/src/app/app.component.ts b/apps/angular/33-decoupling-components/src/app/app.component.ts index 0d78f4d34..c48c3d975 100644 --- a/apps/angular/33-decoupling-components/src/app/app.component.ts +++ b/apps/angular/33-decoupling-components/src/app/app.component.ts @@ -1,10 +1,11 @@ import { BtnDisabledDirective } from '@angular-challenges/decoupling/brain'; import { BtnHelmetDirective } from '@angular-challenges/decoupling/helmet'; -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ imports: [BtnDisabledDirective, BtnHelmetDirective], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` `, diff --git a/apps/angular/33-decoupling-components/tsconfig.app.json b/apps/angular/33-decoupling-components/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/33-decoupling-components/tsconfig.app.json +++ b/apps/angular/33-decoupling-components/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/39-injection-token/src/app/app.component.ts b/apps/angular/39-injection-token/src/app/app.component.ts index 280dc090a..1eab02fcc 100644 --- a/apps/angular/39-injection-token/src/app/app.component.ts +++ b/apps/angular/39-injection-token/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterLink, RouterOutlet } from '@angular/router'; @Component({ @@ -15,6 +15,7 @@ import { RouterLink, RouterOutlet } from '@angular/router'; `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'p-10 flex flex-col', }, diff --git a/apps/angular/39-injection-token/src/app/phone.component.ts b/apps/angular/39-injection-token/src/app/phone.component.ts index 41ee3cfc0..d6846c33a 100644 --- a/apps/angular/39-injection-token/src/app/phone.component.ts +++ b/apps/angular/39-injection-token/src/app/phone.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { TimerContainerComponent } from './timer-container.component'; @Component({ selector: 'app-phone', imports: [TimerContainerComponent], + changeDetection: ChangeDetectionStrategy.Eager, template: `
Phone Call Timer: diff --git a/apps/angular/39-injection-token/src/app/timer-container.component.ts b/apps/angular/39-injection-token/src/app/timer-container.component.ts index 67db6059a..d8403202f 100644 --- a/apps/angular/39-injection-token/src/app/timer-container.component.ts +++ b/apps/angular/39-injection-token/src/app/timer-container.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { DEFAULT_TIMER } from './data'; import { TimerComponent } from './timer.component'; @Component({ @@ -11,6 +11,7 @@ import { TimerComponent } from './timer.component';
`, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'border rounded-md flex p-4 gap-10', }, diff --git a/apps/angular/39-injection-token/src/app/timer.component.ts b/apps/angular/39-injection-token/src/app/timer.component.ts index 335a077bf..442b573a1 100644 --- a/apps/angular/39-injection-token/src/app/timer.component.ts +++ b/apps/angular/39-injection-token/src/app/timer.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { interval } from 'rxjs'; import { DEFAULT_TIMER } from './data'; @Component({ selector: 'timer', + changeDetection: ChangeDetectionStrategy.Eager, template: ` Timer running {{ timer() }} `, diff --git a/apps/angular/39-injection-token/src/app/video.component.ts b/apps/angular/39-injection-token/src/app/video.component.ts index ba0a218b4..910368b3a 100644 --- a/apps/angular/39-injection-token/src/app/video.component.ts +++ b/apps/angular/39-injection-token/src/app/video.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { TimerContainerComponent } from './timer-container.component'; @Component({ selector: 'app-video', imports: [TimerContainerComponent], + changeDetection: ChangeDetectionStrategy.Eager, template: `
Video Call Timer: diff --git a/apps/angular/39-injection-token/tsconfig.app.json b/apps/angular/39-injection-token/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/39-injection-token/tsconfig.app.json +++ b/apps/angular/39-injection-token/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/4-typed-context-outlet/src/app/person.component.ts b/apps/angular/4-typed-context-outlet/src/app/person.component.ts index c0af413fb..bc949018e 100644 --- a/apps/angular/4-typed-context-outlet/src/app/person.component.ts +++ b/apps/angular/4-typed-context-outlet/src/app/person.component.ts @@ -1,10 +1,17 @@ import { NgTemplateOutlet } from '@angular/common'; -import { Component, contentChild, input, TemplateRef } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + contentChild, + input, + TemplateRef, +} from '@angular/core'; @Component({ imports: [NgTemplateOutlet], // eslint-disable-next-line @angular-eslint/component-selector selector: 'person', + changeDetection: ChangeDetectionStrategy.Eager, template: ` `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex w-full px-4 py-5 gap-4 justify-between', }, diff --git a/apps/angular/44-view-transition/src/app/post/post-header.component.ts b/apps/angular/44-view-transition/src/app/post/post-header.component.ts index 6d5f30e54..fa8efb502 100644 --- a/apps/angular/44-view-transition/src/app/post/post-header.component.ts +++ b/apps/angular/44-view-transition/src/app/post/post-header.component.ts @@ -1,5 +1,5 @@ import { NgOptimizedImage } from '@angular/common'; -import { Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @Component({ selector: 'post-header', @@ -17,11 +17,12 @@ import { Component, input } from '@angular/core'; alt="" width="30" height="30" - class="absolute -bottom-2 -right-2" /> + class="absolute -right-2 -bottom-2" />
Thomas Laforge {{ date() }} `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex flex-col justify-center items-center', }, diff --git a/apps/angular/44-view-transition/tsconfig.app.json b/apps/angular/44-view-transition/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/44-view-transition/tsconfig.app.json +++ b/apps/angular/44-view-transition/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/45-react-in-angular/src/app/app.component.ts b/apps/angular/45-react-in-angular/src/app/app.component.ts index 87b9675cc..0bafa69f2 100644 --- a/apps/angular/45-react-in-angular/src/app/app.component.ts +++ b/apps/angular/45-react-in-angular/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, signal } from '@angular/core'; import { PostComponent } from './react/post.component'; type Post = { title: string; description: string }; @@ -26,6 +26,7 @@ type Post = { title: string; description: string }; `, + changeDetection: ChangeDetectionStrategy.Eager, styles: [''], }) export class AppComponent { diff --git a/apps/angular/45-react-in-angular/src/app/react/post.component.ts b/apps/angular/45-react-in-angular/src/app/react/post.component.ts index d5eb2cedf..6b28163d6 100644 --- a/apps/angular/45-react-in-angular/src/app/react/post.component.ts +++ b/apps/angular/45-react-in-angular/src/app/react/post.component.ts @@ -1,4 +1,10 @@ -import { Component, EventEmitter, input, Output } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + input, + Output, +} from '@angular/core'; type Post = { title: string; description: string; pictureLink: string }; @@ -7,6 +13,7 @@ type Post = { title: string; description: string; pictureLink: string }; template: `
`, + changeDetection: ChangeDetectionStrategy.Eager, styles: [''], }) export class PostComponent { diff --git a/apps/angular/45-react-in-angular/tsconfig.app.json b/apps/angular/45-react-in-angular/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/45-react-in-angular/tsconfig.app.json +++ b/apps/angular/45-react-in-angular/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/46-simple-animations/src/app/app.component.ts b/apps/angular/46-simple-animations/src/app/app.component.ts index 576c9915e..783b22b91 100644 --- a/apps/angular/46-simple-animations/src/app/app.component.ts +++ b/apps/angular/46-simple-animations/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ imports: [], selector: 'app-root', styles: ` -@reference "tailwindcss"; + @reference "tailwindcss"; section { @apply flex flex-1 flex-col gap-5; @@ -18,6 +18,7 @@ import { Component } from '@angular/core'; } } `, + changeDetection: ChangeDetectionStrategy.Eager, template: `
diff --git a/apps/angular/46-simple-animations/tsconfig.app.json b/apps/angular/46-simple-animations/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/46-simple-animations/tsconfig.app.json +++ b/apps/angular/46-simple-animations/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/5-crud-application/src/app/app.component.ts b/apps/angular/5-crud-application/src/app/app.component.ts index 73ba0dc34..8f8000bbb 100644 --- a/apps/angular/5-crud-application/src/app/app.component.ts +++ b/apps/angular/5-crud-application/src/app/app.component.ts @@ -1,5 +1,10 @@ import { HttpClient } from '@angular/common/http'; -import { Component, inject, OnInit } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + OnInit, +} from '@angular/core'; import { randText } from '@ngneat/falso'; @Component({ @@ -11,6 +16,7 @@ import { randText } from '@ngneat/falso'; } `, + changeDetection: ChangeDetectionStrategy.Eager, styles: [], }) export class AppComponent implements OnInit { diff --git a/apps/angular/5-crud-application/src/app/app.config.ts b/apps/angular/5-crud-application/src/app/app.config.ts index 1c0c9422f..c0a434946 100644 --- a/apps/angular/5-crud-application/src/app/app.config.ts +++ b/apps/angular/5-crud-application/src/app/app.config.ts @@ -1,6 +1,6 @@ -import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClient, withXhr } from '@angular/common/http'; import { ApplicationConfig } from '@angular/core'; export const appConfig: ApplicationConfig = { - providers: [provideHttpClient()], + providers: [provideHttpClient(withXhr())], }; diff --git a/apps/angular/5-crud-application/tsconfig.app.json b/apps/angular/5-crud-application/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/5-crud-application/tsconfig.app.json +++ b/apps/angular/5-crud-application/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/52-lazy-load-component/src/app/app.component.ts b/apps/angular/52-lazy-load-component/src/app/app.component.ts index a83da5284..32eee073d 100644 --- a/apps/angular/52-lazy-load-component/src/app/app.component.ts +++ b/apps/angular/52-lazy-load-component/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, signal } from '@angular/core'; import { PlaceholderComponent } from './placeholder.component'; import { TopComponent } from './top.component'; @@ -18,6 +18,7 @@ import { TopComponent } from './top.component'; }
`, + changeDetection: ChangeDetectionStrategy.Eager, imports: [TopComponent, PlaceholderComponent], }) export class AppComponent { diff --git a/apps/angular/52-lazy-load-component/src/app/placeholder.component.ts b/apps/angular/52-lazy-load-component/src/app/placeholder.component.ts index 051e39491..df5a6e4e7 100644 --- a/apps/angular/52-lazy-load-component/src/app/placeholder.component.ts +++ b/apps/angular/52-lazy-load-component/src/app/placeholder.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-placeholder', template: ` I'm a placeholder component. `, + changeDetection: ChangeDetectionStrategy.Eager, styles: ` :host { display: grid; diff --git a/apps/angular/52-lazy-load-component/src/app/top.component.ts b/apps/angular/52-lazy-load-component/src/app/top.component.ts index d9104bef3..196c4463c 100644 --- a/apps/angular/52-lazy-load-component/src/app/top.component.ts +++ b/apps/angular/52-lazy-load-component/src/app/top.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-top', template: ` I am a very heavy, expensive component that should be lazy loaded. `, + changeDetection: ChangeDetectionStrategy.Eager, styles: ` :host { display: grid; diff --git a/apps/angular/52-lazy-load-component/tsconfig.app.json b/apps/angular/52-lazy-load-component/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/52-lazy-load-component/tsconfig.app.json +++ b/apps/angular/52-lazy-load-component/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/55-back-button-navigation/src/app/app.component.ts b/apps/angular/55-back-button-navigation/src/app/app.component.ts index baffdae25..82e9330e2 100644 --- a/apps/angular/55-back-button-navigation/src/app/app.component.ts +++ b/apps/angular/55-back-button-navigation/src/app/app.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterLink, RouterOutlet } from '@angular/router'; @Component({ imports: [RouterOutlet, RouterLink], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, templateUrl: './app.component.html', }) export class AppComponent {} diff --git a/apps/angular/55-back-button-navigation/src/app/home/home.component.ts b/apps/angular/55-back-button-navigation/src/app/home/home.component.ts index 18c4147b1..5e048470f 100644 --- a/apps/angular/55-back-button-navigation/src/app/home/home.component.ts +++ b/apps/angular/55-back-button-navigation/src/app/home/home.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { RouterLink } from '@angular/router'; @Component({ imports: [MatButtonModule, RouterLink], selector: 'app-home', + changeDetection: ChangeDetectionStrategy.Eager, templateUrl: './home.component.html', }) export class HomeComponent {} diff --git a/apps/angular/55-back-button-navigation/src/app/sensitive-action/sensitive-action.component.ts b/apps/angular/55-back-button-navigation/src/app/sensitive-action/sensitive-action.component.ts index a97282c33..08fefd979 100644 --- a/apps/angular/55-back-button-navigation/src/app/sensitive-action/sensitive-action.component.ts +++ b/apps/angular/55-back-button-navigation/src/app/sensitive-action/sensitive-action.component.ts @@ -1,4 +1,4 @@ -import { Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; import { DialogComponent } from '../dialog/dialog.component'; @@ -6,6 +6,7 @@ import { DialogComponent } from '../dialog/dialog.component'; @Component({ imports: [MatButtonModule], selector: 'app-sensitive-action', + changeDetection: ChangeDetectionStrategy.Eager, templateUrl: './sensitive-action.component.html', }) export class SensitiveActionComponent { diff --git a/apps/angular/55-back-button-navigation/src/app/simple-action/simple-action.component.ts b/apps/angular/55-back-button-navigation/src/app/simple-action/simple-action.component.ts index fe97e7368..c6df8c5da 100644 --- a/apps/angular/55-back-button-navigation/src/app/simple-action/simple-action.component.ts +++ b/apps/angular/55-back-button-navigation/src/app/simple-action/simple-action.component.ts @@ -1,4 +1,4 @@ -import { Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; import { DialogComponent } from '../dialog/dialog.component'; @@ -6,6 +6,7 @@ import { DialogComponent } from '../dialog/dialog.component'; @Component({ imports: [MatButtonModule], selector: 'app-simple-action', + changeDetection: ChangeDetectionStrategy.Eager, templateUrl: './simple-action.component.html', }) export class SimpleActionComponent { diff --git a/apps/angular/55-back-button-navigation/tsconfig.app.json b/apps/angular/55-back-button-navigation/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/55-back-button-navigation/tsconfig.app.json +++ b/apps/angular/55-back-button-navigation/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/57-content-projection-default/tsconfig.app.json b/apps/angular/57-content-projection-default/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/57-content-projection-default/tsconfig.app.json +++ b/apps/angular/57-content-projection-default/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/58-content-projection-condition/tsconfig.app.json b/apps/angular/58-content-projection-condition/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/58-content-projection-condition/tsconfig.app.json +++ b/apps/angular/58-content-projection-condition/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/59-content-projection-defer/src/app/app.config.ts b/apps/angular/59-content-projection-defer/src/app/app.config.ts index faf4d099a..f5081421d 100644 --- a/apps/angular/59-content-projection-defer/src/app/app.config.ts +++ b/apps/angular/59-content-projection-defer/src/app/app.config.ts @@ -1,4 +1,4 @@ -import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClient, withXhr } from '@angular/common/http'; import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { provideRouter } from '@angular/router'; import { appRoutes } from './app.routes'; @@ -7,6 +7,6 @@ export const appConfig: ApplicationConfig = { providers: [ provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(appRoutes), - provideHttpClient(), + provideHttpClient(withXhr()), ], }; diff --git a/apps/angular/59-content-projection-defer/tsconfig.app.json b/apps/angular/59-content-projection-defer/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/angular/59-content-projection-defer/tsconfig.app.json +++ b/apps/angular/59-content-projection-defer/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/6-structural-directive/src/app/login.component.ts b/apps/angular/6-structural-directive/src/app/login.component.ts index f38e5e5ca..bd05ed414 100644 --- a/apps/angular/6-structural-directive/src/app/login.component.ts +++ b/apps/angular/6-structural-directive/src/app/login.component.ts @@ -1,4 +1,4 @@ -import { Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { RouterLink } from '@angular/router'; import { ButtonComponent } from './button.component'; import { InformationComponent } from './information.component'; @@ -16,6 +16,7 @@ import { UserStore } from './user.store'; @Component({ imports: [InformationComponent, RouterLink, ButtonComponent], selector: 'app-login', + changeDetection: ChangeDetectionStrategy.Eager, template: `
Log as : diff --git a/apps/angular/6-structural-directive/tsconfig.app.json b/apps/angular/6-structural-directive/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/6-structural-directive/tsconfig.app.json +++ b/apps/angular/6-structural-directive/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/60-async-redirect/tsconfig.app.json b/apps/angular/60-async-redirect/tsconfig.app.json index 5d5af52c7..a953c5889 100644 --- a/apps/angular/60-async-redirect/tsconfig.app.json +++ b/apps/angular/60-async-redirect/tsconfig.app.json @@ -10,5 +10,13 @@ "src/test-setup.ts", "src/**/*.test.ts", "src/**/*.spec.ts" - ] + ], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/8-pure-pipe/src/app/app.component.ts b/apps/angular/8-pure-pipe/src/app/app.component.ts index 930fe1313..a1164df21 100644 --- a/apps/angular/8-pure-pipe/src/app/app.component.ts +++ b/apps/angular/8-pure-pipe/src/app/app.component.ts @@ -1,7 +1,8 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` @for (person of persons; track person) { {{ heavyComputation(person, $index) }} diff --git a/apps/angular/8-pure-pipe/tsconfig.app.json b/apps/angular/8-pure-pipe/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/8-pure-pipe/tsconfig.app.json +++ b/apps/angular/8-pure-pipe/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/angular/9-wrap-function-pipe/src/app/app.component.ts b/apps/angular/9-wrap-function-pipe/src/app/app.component.ts index af8b6ff73..f01c99218 100644 --- a/apps/angular/9-wrap-function-pipe/src/app/app.component.ts +++ b/apps/angular/9-wrap-function-pipe/src/app/app.component.ts @@ -1,7 +1,8 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` @for (person of persons; track person.name) { {{ showName(person.name, $index) }} diff --git a/apps/angular/9-wrap-function-pipe/tsconfig.app.json b/apps/angular/9-wrap-function-pipe/tsconfig.app.json index 2a1ca1b8d..ec3e2853a 100644 --- a/apps/angular/9-wrap-function-pipe/tsconfig.app.json +++ b/apps/angular/9-wrap-function-pipe/tsconfig.app.json @@ -9,5 +9,13 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/41-control-value-accessor/src/app/app.component.ts b/apps/forms/41-control-value-accessor/src/app/app.component.ts index 69134b864..1de5c26bf 100644 --- a/apps/forms/41-control-value-accessor/src/app/app.component.ts +++ b/apps/forms/41-control-value-accessor/src/app/app.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { FeedbackFormComponent } from './feedback-form/feedback-form.component'; @Component({ imports: [FeedbackFormComponent], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` `, diff --git a/apps/forms/41-control-value-accessor/src/app/feedback-form/feedback-form.component.ts b/apps/forms/41-control-value-accessor/src/app/feedback-form/feedback-form.component.ts index fdbafddc2..44c04b5a9 100644 --- a/apps/forms/41-control-value-accessor/src/app/feedback-form/feedback-form.component.ts +++ b/apps/forms/41-control-value-accessor/src/app/feedback-form/feedback-form.component.ts @@ -1,4 +1,9 @@ -import { Component, EventEmitter, Output } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + Output, +} from '@angular/core'; import { FormControl, FormGroup, @@ -11,6 +16,7 @@ import { RatingControlComponent } from '../rating-control/rating-control.compone imports: [RatingControlComponent, ReactiveFormsModule], selector: 'app-feedback-form', templateUrl: 'feedback-form.component.html', + changeDetection: ChangeDetectionStrategy.Eager, styleUrls: ['feedback-form.component.css'], }) export class FeedbackFormComponent { diff --git a/apps/forms/41-control-value-accessor/src/app/rating-control/rating-control.component.ts b/apps/forms/41-control-value-accessor/src/app/rating-control/rating-control.component.ts index 629f5d084..479712749 100644 --- a/apps/forms/41-control-value-accessor/src/app/rating-control/rating-control.component.ts +++ b/apps/forms/41-control-value-accessor/src/app/rating-control/rating-control.component.ts @@ -1,8 +1,14 @@ -import { Component, EventEmitter, Output } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + Output, +} from '@angular/core'; @Component({ selector: 'app-rating-control', templateUrl: 'rating-control.component.html', + changeDetection: ChangeDetectionStrategy.Eager, styleUrls: ['rating-control.component.css'], }) export class RatingControlComponent { diff --git a/apps/forms/41-control-value-accessor/tsconfig.app.json b/apps/forms/41-control-value-accessor/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/forms/41-control-value-accessor/tsconfig.app.json +++ b/apps/forms/41-control-value-accessor/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/48-avoid-losing-form-data/src/app/app.component.ts b/apps/forms/48-avoid-losing-form-data/src/app/app.component.ts index 2b5adc443..d7ade7556 100644 --- a/apps/forms/48-avoid-losing-form-data/src/app/app.component.ts +++ b/apps/forms/48-avoid-losing-form-data/src/app/app.component.ts @@ -1,14 +1,15 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; import { NavComponent } from './ui/nav.component'; @Component({ imports: [RouterOutlet, NavComponent], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: `
+ class="mx-auto flex w-full items-center justify-center pt-8 pb-2" />
diff --git a/apps/forms/48-avoid-losing-form-data/tsconfig.app.json b/apps/forms/48-avoid-losing-form-data/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/forms/48-avoid-losing-form-data/tsconfig.app.json +++ b/apps/forms/48-avoid-losing-form-data/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/61-simplest-signal-form/src/app/app.component.ts b/apps/forms/61-simplest-signal-form/src/app/app.component.ts index 48edfb268..f0dfe8b59 100644 --- a/apps/forms/61-simplest-signal-form/src/app/app.component.ts +++ b/apps/forms/61-simplest-signal-form/src/app/app.component.ts @@ -1,5 +1,10 @@ import { JsonPipe } from '@angular/common'; -import { Component, signal, WritableSignal } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + signal, + WritableSignal, +} from '@angular/core'; import { FormControl, FormGroup, @@ -10,6 +15,7 @@ import { @Component({ selector: 'app-root', imports: [ReactiveFormsModule, JsonPipe], + changeDetection: ChangeDetectionStrategy.Eager, template: `
@@ -28,7 +34,7 @@ import { type="text" formControlName="name" placeholder="Enter your name" - class="w-full rounded-md border border-gray-300 px-4 py-2 outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500" + class="w-full rounded-md border border-gray-300 px-4 py-2 transition outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500" [class.border-red-500]=" form.controls.name.invalid && !form.controls.name.untouched " /> @@ -48,7 +54,7 @@ import { type="text" formControlName="lastname" placeholder="Enter your last name" - class="w-full rounded-md border border-gray-300 px-4 py-2 outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500" /> + class="w-full rounded-md border border-gray-300 px-4 py-2 transition outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500" />
@@ -64,7 +70,7 @@ import { placeholder="Enter your age (1-99)" min="1" max="99" - class="w-full rounded-md border border-gray-300 px-4 py-2 outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500" + class="w-full rounded-md border border-gray-300 px-4 py-2 transition outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500" [class.border-red-500]=" form.controls.age.invalid && !form.controls.age.untouched " /> @@ -91,7 +97,7 @@ import { type="text" formControlName="note" placeholder="Enter a note" - class="w-full rounded-md border border-gray-300 px-4 py-2 outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500" /> + class="w-full rounded-md border border-gray-300 px-4 py-2 transition outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500" />
diff --git a/apps/forms/61-simplest-signal-form/tsconfig.app.json b/apps/forms/61-simplest-signal-form/tsconfig.app.json index ba6acbecd..b321bd07a 100644 --- a/apps/forms/61-simplest-signal-form/tsconfig.app.json +++ b/apps/forms/61-simplest-signal-form/tsconfig.app.json @@ -5,5 +5,13 @@ "types": [] }, "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/62-crossfield-validation-signal-form/tsconfig.app.json b/apps/forms/62-crossfield-validation-signal-form/tsconfig.app.json index ea5509a27..8f5ee17df 100644 --- a/apps/forms/62-crossfield-validation-signal-form/tsconfig.app.json +++ b/apps/forms/62-crossfield-validation-signal-form/tsconfig.app.json @@ -11,5 +11,13 @@ "jest.config.ts", "jest.config.cts", "src/test-setup.ts" - ] + ], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/63-child-forms/tsconfig.app.json b/apps/forms/63-child-forms/tsconfig.app.json index ba6acbecd..b321bd07a 100644 --- a/apps/forms/63-child-forms/tsconfig.app.json +++ b/apps/forms/63-child-forms/tsconfig.app.json @@ -5,5 +5,13 @@ "types": [] }, "include": ["src/**/*.ts"], - "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"] + "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/forms/64-form-array/src/app/contact-form.component.ts b/apps/forms/64-form-array/src/app/contact-form.component.ts index eaf27cd02..cb681bcdd 100644 --- a/apps/forms/64-form-array/src/app/contact-form.component.ts +++ b/apps/forms/64-form-array/src/app/contact-form.component.ts @@ -1,4 +1,9 @@ -import { Component, input, output } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + input, + output, +} from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; type ContactFormGroup = FormGroup<{ @@ -11,6 +16,7 @@ type ContactFormGroup = FormGroup<{ @Component({ selector: 'app-contact-form', imports: [ReactiveFormsModule], + changeDetection: ChangeDetectionStrategy.Eager, template: `
`, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex flex-col', }, diff --git a/apps/nx/42-static-vs-dynamic-import/tsconfig.app.json b/apps/nx/42-static-vs-dynamic-import/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/nx/42-static-vs-dynamic-import/tsconfig.app.json +++ b/apps/nx/42-static-vs-dynamic-import/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/performance/12-optimize-change-detection/src/app/app.component.ts b/apps/performance/12-optimize-change-detection/src/app/app.component.ts index 52b7fa855..d22dcab39 100644 --- a/apps/performance/12-optimize-change-detection/src/app/app.component.ts +++ b/apps/performance/12-optimize-change-detection/src/app/app.component.ts @@ -1,4 +1,9 @@ -import { Component, HostListener, signal } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + HostListener, + signal, +} from '@angular/core'; @Component({ selector: 'app-root', @@ -10,6 +15,7 @@ import { Component, HostListener, signal } from '@angular/core'; } `, + changeDetection: ChangeDetectionStrategy.Eager, styles: [ ` :host { diff --git a/apps/performance/12-optimize-change-detection/tsconfig.app.json b/apps/performance/12-optimize-change-detection/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/performance/12-optimize-change-detection/tsconfig.app.json +++ b/apps/performance/12-optimize-change-detection/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/performance/34-default-vs-onpush/src/app/app.component.ts b/apps/performance/34-default-vs-onpush/src/app/app.component.ts index 88b0a6571..cdef49de9 100644 --- a/apps/performance/34-default-vs-onpush/src/app/app.component.ts +++ b/apps/performance/34-default-vs-onpush/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { randFirstName } from '@ngneat/falso'; import { PersonListComponent } from './person-list.component'; import { RandomComponent } from './random.component'; @@ -6,6 +6,7 @@ import { RandomComponent } from './random.component'; @Component({ imports: [PersonListComponent, RandomComponent], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` diff --git a/apps/performance/34-default-vs-onpush/src/app/person-list.component.ts b/apps/performance/34-default-vs-onpush/src/app/person-list.component.ts index e34a39e87..dc81b888e 100644 --- a/apps/performance/34-default-vs-onpush/src/app/person-list.component.ts +++ b/apps/performance/34-default-vs-onpush/src/app/person-list.component.ts @@ -1,4 +1,4 @@ -import { Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; import { CDFlashingDirective } from '@angular-challenges/shared/directives'; import { TitleCasePipe } from '@angular/common'; @@ -51,6 +51,7 @@ import { MatListModule } from '@angular/material/list'; } `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'w-full flex flex-col items-center', }, diff --git a/apps/performance/34-default-vs-onpush/src/app/random.component.ts b/apps/performance/34-default-vs-onpush/src/app/random.component.ts index 71479e28d..bd118765d 100644 --- a/apps/performance/34-default-vs-onpush/src/app/random.component.ts +++ b/apps/performance/34-default-vs-onpush/src/app/random.component.ts @@ -1,11 +1,12 @@ import { CDFlashingDirective } from '@angular-challenges/shared/directives'; -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; @Component({ selector: 'app-random', template: `
I do nothing but I'm here
`, + changeDetection: ChangeDetectionStrategy.Eager, imports: [CDFlashingDirective], }) export class RandomComponent {} diff --git a/apps/performance/34-default-vs-onpush/tsconfig.app.json b/apps/performance/34-default-vs-onpush/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/performance/34-default-vs-onpush/tsconfig.app.json +++ b/apps/performance/34-default-vs-onpush/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/performance/35-memoization/src/app/app.component.ts b/apps/performance/35-memoization/src/app/app.component.ts index 44e55db4f..a892525df 100644 --- a/apps/performance/35-memoization/src/app/app.component.ts +++ b/apps/performance/35-memoization/src/app/app.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { generateList } from './generateList'; import { PersonListComponent } from './person-list.component'; @Component({ imports: [PersonListComponent], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: `

Performance is key!!

} `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'w-full flex flex-col', }, diff --git a/apps/performance/36-ngfor-optimization/tsconfig.app.json b/apps/performance/36-ngfor-optimization/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/performance/36-ngfor-optimization/tsconfig.app.json +++ b/apps/performance/36-ngfor-optimization/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/performance/37-optimize-big-list/src/app/app.component.ts b/apps/performance/37-optimize-big-list/src/app/app.component.ts index a5f121b22..2f8b2322c 100644 --- a/apps/performance/37-optimize-big-list/src/app/app.component.ts +++ b/apps/performance/37-optimize-big-list/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, signal } from '@angular/core'; +import { ChangeDetectionStrategy, Component, signal } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -26,6 +26,7 @@ import { PersonListComponent } from './person-list.component'; } `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'flex items-center flex-col gap-5', }, diff --git a/apps/performance/37-optimize-big-list/tsconfig.app.json b/apps/performance/37-optimize-big-list/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/performance/37-optimize-big-list/tsconfig.app.json +++ b/apps/performance/37-optimize-big-list/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/performance/40-web-workers/src/app/app.component.ts b/apps/performance/40-web-workers/src/app/app.component.ts index da63f1012..95079623d 100644 --- a/apps/performance/40-web-workers/src/app/app.component.ts +++ b/apps/performance/40-web-workers/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { HeavyCalculationService } from './heavy-calculation.service'; import { UnknownPersonComponent } from './unknown-person/unknown-person.component'; @@ -15,6 +15,7 @@ import { UnknownPersonComponent } from './unknown-person/unknown-person.componen
Progress: {{ loadingPercentage() }}%
`, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: `flex flex-col h-screen w-screen bg-[#1f75c0]`, }, diff --git a/apps/performance/40-web-workers/src/app/unknown-person/unknown-person.component.ts b/apps/performance/40-web-workers/src/app/unknown-person/unknown-person.component.ts index 600724281..21774444a 100644 --- a/apps/performance/40-web-workers/src/app/unknown-person/unknown-person.component.ts +++ b/apps/performance/40-web-workers/src/app/unknown-person/unknown-person.component.ts @@ -1,4 +1,4 @@ -import { Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, input } from '@angular/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector @@ -9,7 +9,7 @@ import { Component, input } from '@angular/core'; [style.height.%]="100 - step()"> @if (step() !== 100) {
+ class="relative top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"> Who is here?
} @@ -29,6 +29,7 @@ import { Component, input } from '@angular/core';
`, + changeDetection: ChangeDetectionStrategy.Eager, styleUrls: [`unknown-person.component.css`], }) export class UnknownPersonComponent { diff --git a/apps/performance/40-web-workers/tsconfig.app.json b/apps/performance/40-web-workers/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/performance/40-web-workers/tsconfig.app.json +++ b/apps/performance/40-web-workers/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/rxjs/11-high-order-operator-bug/src/app/app.component.ts b/apps/rxjs/11-high-order-operator-bug/src/app/app.component.ts index fb80fb2b6..4e15bf99b 100644 --- a/apps/rxjs/11-high-order-operator-bug/src/app/app.component.ts +++ b/apps/rxjs/11-high-order-operator-bug/src/app/app.component.ts @@ -1,11 +1,18 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component, inject, input, signal } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + input, + signal, +} from '@angular/core'; import { take } from 'rxjs'; import { AppService } from './app.service'; import { TopicType } from './localDB.service'; @Component({ selector: 'button-delete-topic', + changeDetection: ChangeDetectionStrategy.Eager, template: `
{{ message() }}
@@ -35,6 +42,7 @@ export class ButtonDeleteComponent { @Component({ imports: [ButtonDeleteComponent], selector: 'app-root', + changeDetection: ChangeDetectionStrategy.Eager, template: ` @for (info of allInfo(); track info.id) {
{{ info.id }} - {{ info.topic }}
diff --git a/apps/rxjs/11-high-order-operator-bug/tsconfig.app.json b/apps/rxjs/11-high-order-operator-bug/tsconfig.app.json index 44ab2b22f..6649f5fa7 100644 --- a/apps/rxjs/11-high-order-operator-bug/tsconfig.app.json +++ b/apps/rxjs/11-high-order-operator-bug/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"] + "exclude": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/rxjs/14-race-condition/tsconfig.app.json b/apps/rxjs/14-race-condition/tsconfig.app.json index 5fdad8685..5c190a478 100644 --- a/apps/rxjs/14-race-condition/tsconfig.app.json +++ b/apps/rxjs/14-race-condition/tsconfig.app.json @@ -17,5 +17,13 @@ "**/*.cy.js", "**/*.cy.tsx", "**/*.cy.jsx" - ] + ], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/rxjs/38-catch-error/src/app/app.component.ts b/apps/rxjs/38-catch-error/src/app/app.component.ts index 65e177567..789bb61c0 100644 --- a/apps/rxjs/38-catch-error/src/app/app.component.ts +++ b/apps/rxjs/38-catch-error/src/app/app.component.ts @@ -1,6 +1,12 @@ import { CommonModule } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + DestroyRef, + OnInit, + inject, +} from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { FormsModule } from '@angular/forms'; import { Subject, concatMap, map } from 'rxjs'; @@ -26,6 +32,7 @@ import { Subject, concatMap, map } from 'rxjs'; {{ response | json }}
`, + changeDetection: ChangeDetectionStrategy.Eager, styleUrls: ['./app.component.css'], }) export class AppComponent implements OnInit { diff --git a/apps/rxjs/38-catch-error/src/app/app.config.ts b/apps/rxjs/38-catch-error/src/app/app.config.ts index 1c0c9422f..c0a434946 100644 --- a/apps/rxjs/38-catch-error/src/app/app.config.ts +++ b/apps/rxjs/38-catch-error/src/app/app.config.ts @@ -1,6 +1,6 @@ -import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClient, withXhr } from '@angular/common/http'; import { ApplicationConfig } from '@angular/core'; export const appConfig: ApplicationConfig = { - providers: [provideHttpClient()], + providers: [provideHttpClient(withXhr())], }; diff --git a/apps/rxjs/38-catch-error/tsconfig.app.json b/apps/rxjs/38-catch-error/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/rxjs/38-catch-error/tsconfig.app.json +++ b/apps/rxjs/38-catch-error/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/rxjs/49-hold-to-save-button/tsconfig.app.json b/apps/rxjs/49-hold-to-save-button/tsconfig.app.json index 8b5631268..e4073fab3 100644 --- a/apps/rxjs/49-hold-to-save-button/tsconfig.app.json +++ b/apps/rxjs/49-hold-to-save-button/tsconfig.app.json @@ -7,5 +7,13 @@ }, "files": ["src/main.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"], + "angularCompilerOptions": { + "extendedDiagnostics": { + "checks": { + "nullishCoalescingNotNullable": "suppress", + "optionalChainNotNullable": "suppress" + } + } + } } diff --git a/apps/signal/30-interop-rxjs-signal/src/app/app.component.ts b/apps/signal/30-interop-rxjs-signal/src/app/app.component.ts index 54fa2b85d..918050ba3 100644 --- a/apps/signal/30-interop-rxjs-signal/src/app/app.component.ts +++ b/apps/signal/30-interop-rxjs-signal/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; @Component({ @@ -7,6 +7,7 @@ import { RouterOutlet } from '@angular/router'; template: ` `, + changeDetection: ChangeDetectionStrategy.Eager, styles: [''], }) export class AppComponent {} diff --git a/apps/signal/30-interop-rxjs-signal/src/app/app.config.ts b/apps/signal/30-interop-rxjs-signal/src/app/app.config.ts index 2885bb0de..47617e977 100644 --- a/apps/signal/30-interop-rxjs-signal/src/app/app.config.ts +++ b/apps/signal/30-interop-rxjs-signal/src/app/app.config.ts @@ -1,11 +1,11 @@ -import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClient, withXhr } from '@angular/common/http'; import { ApplicationConfig } from '@angular/core'; import { provideAnimations } from '@angular/platform-browser/animations'; import { provideRouter, withComponentInputBinding } from '@angular/router'; export const appConfig: ApplicationConfig = { providers: [ - provideHttpClient(), + provideHttpClient(withXhr()), provideAnimations(), provideRouter( [ diff --git a/apps/signal/30-interop-rxjs-signal/src/app/detail/detail.component.ts b/apps/signal/30-interop-rxjs-signal/src/app/detail/detail.component.ts index 070bf7d7c..e179cf3df 100644 --- a/apps/signal/30-interop-rxjs-signal/src/app/detail/detail.component.ts +++ b/apps/signal/30-interop-rxjs-signal/src/app/detail/detail.component.ts @@ -1,5 +1,9 @@ import { DatePipe } from '@angular/common'; -import { Component, Input as RouterInput } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + Input as RouterInput, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { Photo } from '../photo.model'; @@ -31,6 +35,7 @@ import { Photo } from '../photo.model'; Back `, + changeDetection: ChangeDetectionStrategy.Eager, host: { class: 'p-5 block', }, diff --git a/apps/signal/30-interop-rxjs-signal/src/app/list/photos.component.ts b/apps/signal/30-interop-rxjs-signal/src/app/list/photos.component.ts index 9ba76faba..528c14003 100644 --- a/apps/signal/30-interop-rxjs-signal/src/app/list/photos.component.ts +++ b/apps/signal/30-interop-rxjs-signal/src/app/list/photos.component.ts @@ -1,5 +1,10 @@ import { AsyncPipe } from '@angular/common'; -import { Component, inject, OnInit } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + inject, + OnInit, +} from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -63,11 +68,7 @@ import { PhotoStore } from './photos.store'; } @if (vm.photos && vm.photos.length > 0) {