Skip to content

Commit 8e87965

Browse files
committed
Update Angular starters to Angular v21
1 parent 3296f80 commit 8e87965

File tree

20 files changed

+27415
-18712
lines changed

20 files changed

+27415
-18712
lines changed

starters/angular/ai-chatbot/package-lock.json

Lines changed: 4539 additions & 3102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

starters/angular/ai-chatbot/package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/common": "^20.0.0",
15-
"@angular/compiler": "^20.0.0",
16-
"@angular/core": "^20.0.0",
17-
"@angular/forms": "^20.0.0",
18-
"@angular/platform-browser": "^20.0.0",
19-
"@angular/platform-browser-dynamic": "^20.0.0",
20-
"@angular/platform-server": "^20.0.0",
21-
"@angular/router": "^20.0.0",
22-
"@angular/ssr": "^20.0.0",
14+
"@angular/common": "^21.0.0",
15+
"@angular/compiler": "^21.0.0",
16+
"@angular/core": "^21.0.0",
17+
"@angular/forms": "^21.0.0",
18+
"@angular/platform-browser": "^21.0.0",
19+
"@angular/platform-browser-dynamic": "^21.0.0",
20+
"@angular/platform-server": "^21.0.0",
21+
"@angular/router": "^21.0.0",
22+
"@angular/ssr": "^21.0.0",
2323
"@google/generative-ai": "^0.24.0",
24-
"@ngx-templates/shared": "^1.0.3",
24+
"@ngx-templates/shared": "^1.0.4",
2525
"@types/showdown": "^2.0.6",
2626
"express": "^4.18.2",
2727
"immutable": "^5.0.3",
@@ -32,9 +32,10 @@
3232
"zone.js": "~0.15.0"
3333
},
3434
"devDependencies": {
35-
"@angular-devkit/build-angular": "^20.0.0",
36-
"@angular/cli": "^20.0.0",
37-
"@angular/compiler-cli": "^20.0.0",
35+
"@angular-devkit/build-angular": "^21.0.0",
36+
"@angular/build": "^21.0.0",
37+
"@angular/cli": "^21.0.0",
38+
"@angular/compiler-cli": "^21.0.0",
3839
"@types/express": "^4.17.17",
3940
"@types/jasmine": "~5.1.0",
4041
"@types/node": "^18.18.0",
@@ -45,6 +46,6 @@
4546
"karma-coverage": "~2.2.0",
4647
"karma-jasmine": "~5.1.0",
4748
"karma-jasmine-html-reporter": "~2.1.0",
48-
"typescript": "~5.8.3"
49+
"typescript": "~5.9.3"
4950
}
5051
}
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
import { bootstrapApplication } from '@angular/platform-browser';
1+
import { provideZoneChangeDetection } from '@angular/core';
2+
import {
3+
bootstrapApplication,
4+
BootstrapContext,
5+
} from '@angular/platform-browser';
26
import { AppComponent } from './app/app.component';
37
import { config } from './app/app.config.server';
48

5-
const bootstrap = () => bootstrapApplication(AppComponent, config);
9+
const bootstrap = (context: BootstrapContext) =>
10+
bootstrapApplication(
11+
AppComponent,
12+
{
13+
...config,
14+
providers: [provideZoneChangeDetection(), ...config.providers],
15+
},
16+
context,
17+
);
618

719
export default bootstrap;

starters/angular/ai-chatbot/src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function printRequestData(req: express.Request) {
4242
app.post('/api/gemini', async (req, res) => {
4343
let model = ctx.get(req.path);
4444
if (!model) {
45-
model = genAI.getGenerativeModel({ model: 'gemini-1.5-flash' });
45+
model = genAI.getGenerativeModel({ model: 'gemini-2.5-flash' });
4646
ctx.set(req.path, model);
4747
}
4848

@@ -62,7 +62,7 @@ app.post('/api/gemini', async (req, res) => {
6262
app.post('/api/gemini-chat', async (req, res) => {
6363
let chat = ctx.get(req.path);
6464
if (!chat) {
65-
const model = genAI.getGenerativeModel({ model: 'gemini-1.5-flash' });
65+
const model = genAI.getGenerativeModel({ model: 'gemini-2.5-flash' });
6666
chat = model.startChat({
6767
history: [
6868
{

0 commit comments

Comments
 (0)