feat: upgrade angular to version 21#15
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
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/*ngForand some imperative logic with@if/@for/@letand 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 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 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
approved these changes
May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #10