Skip to content

feat: upgrade angular to version 21#15

Merged
lissy93 merged 2 commits into
lissy93:mainfrom
nigrosimone:ng-21
May 3, 2026
Merged

feat: upgrade angular to version 21#15
lissy93 merged 2 commits into
lissy93:mainfrom
nigrosimone:ng-21

Conversation

@nigrosimone
Copy link
Copy Markdown
Contributor

@nigrosimone nigrosimone commented May 1, 2026

  • provideZonelessChangeDetection
  • ChangeDetectionStrategy.OnPush
  • signal / computed

close #10

nigrosimone and others added 2 commits May 1, 2026 14:03
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 2, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the Angular implementation of the weather app to Angular v21 and modernizes the app to use zoneless change detection, signal-based state, and the new template control-flow syntax.

Changes:

  • Upgrade Angular dependencies to v21 and switch HttpClient to the Fetch backend.
  • Enable zoneless change detection and migrate component inputs/state to signals + ChangeDetectionStrategy.OnPush.
  • Replace *ngIf/*ngFor and some imperative logic with @if/@for/@let and computed signals.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/angular/package.json Bumps Angular/TS dependencies and removes zone.js dependency.
apps/angular/angular.json Removes zone.js polyfill configuration for zoneless mode.
apps/angular/tsconfig.json Updates TS compiler options (e.g., rootDir, moduleResolution).
apps/angular/src/main.ts Enables zoneless change detection and switches HttpClient to withFetch().
apps/angular/src/app/app.component.ts Migrates root component to signal-based state consumption + OnPush.
apps/angular/src/app/services/weather-state.service.ts Replaces BehaviorSubject state with a writable signal and readonly view.
apps/angular/src/app/services/weather.service.ts Minor typing tweak in geocoding response mapping.
apps/angular/src/app/components/search-form.component.ts Converts inputs/outputs to signal-based APIs and binds input to a city signal.
apps/angular/src/app/components/weather-content.component.ts Migrates inputs to signal-based APIs and updates bindings accordingly.
apps/angular/src/app/components/loading-state.component.ts Migrates input to signal-based API and updates bindings.
apps/angular/src/app/components/error-state.component.ts Migrates inputs to signal-based APIs and updates bindings.
apps/angular/src/app/components/current-weather.component.ts Replaces template methods with computed() values and adds OnPush.
apps/angular/src/app/components/forecast.component.ts Migrates to signals + new control-flow syntax and updates scrolling logic.
apps/angular/src/app/components/forecast-item.component.ts Replaces imperative getters with computed() values and signal inputs/outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/angular/package.json
Comment on lines +13 to +20
"@angular/animations": "^21.2.11",
"@angular/common": "^21.2.11",
"@angular/compiler": "^21.2.11",
"@angular/core": "^21.2.11",
"@angular/forms": "^21.2.11",
"@angular/platform-browser": "^21.2.11",
"@angular/platform-browser-dynamic": "^21.2.11",
"@angular/router": "^21.2.11",
Comment thread apps/angular/package.json
Comment on lines +25 to +26
"@angular-devkit/build-angular": "^21.2.9",
"@angular/cli": "^21.2.9",
Comment on lines +40 to +46
this.activeForecastIndex.set(index);
afterNextRender(() => {
const activeElement = (this.elementRef.nativeElement as HTMLElement).querySelector('.forecast-item.active');
if (activeElement) {
activeElement.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
}, 100);
});
@lissy93 lissy93 merged commit 318bc23 into lissy93:main May 3, 2026
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular v17

3 participants