change angular version 20 to 21
This commit is contained in:
parent
883fcfb1a5
commit
90d8e08859
4 changed files with 1667 additions and 1307 deletions
2923
package-lock.json
generated
2923
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
|
@ -10,21 +10,21 @@
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "^20.3.14",
|
"@angular/common": "^21.0.1",
|
||||||
"@angular/compiler": "^20.3.14",
|
"@angular/compiler": "^21.0.1",
|
||||||
"@angular/core": "^20.3.14",
|
"@angular/core": "^21.0.1",
|
||||||
"@angular/forms": "^20.3.14",
|
"@angular/forms": "^21.0.1",
|
||||||
"@angular/platform-browser": "^20.3.14",
|
"@angular/platform-browser": "^21.0.1",
|
||||||
"@angular/platform-browser-dynamic": "^20.3.14",
|
"@angular/platform-browser-dynamic": "^21.0.1",
|
||||||
"@angular/router": "^20.3.14",
|
"@angular/router": "^21.0.1",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"zone.js": "~0.15.0"
|
"zone.js": "~0.15.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/build": "^20.3.12",
|
"@angular/build": "^21.0.0",
|
||||||
"@angular/cli": "^20.3.12",
|
"@angular/cli": "^21.0.0",
|
||||||
"@angular/compiler-cli": "^20.3.14",
|
"@angular/compiler-cli": "^21.0.1",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.0",
|
||||||
"jasmine-core": "~5.6.0",
|
"jasmine-core": "~5.6.0",
|
||||||
"karma": "~6.4.0",
|
"karma": "~6.4.0",
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
<h1>home works!</h1>
|
<h1>home works!</h1>
|
||||||
|
|
||||||
<h2>Task List</h2>
|
<h2>Task List</h2>
|
||||||
<ng-container *ngIf="tasks$ | async as tasks; else loading">
|
@if (tasks$ | async; as tasks) {
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let task of tasks">
|
@for (task of tasks; track task) {
|
||||||
{{ task.title }}
|
<li>
|
||||||
</li>
|
{{ task.title }}
|
||||||
</ul>
|
</li>
|
||||||
</ng-container>
|
}
|
||||||
<ng-template #loading>
|
</ul>
|
||||||
<p>Loading tasks...</p>
|
} @else {
|
||||||
</ng-template>
|
<p>Loading tasks...</p>
|
||||||
|
}
|
||||||
|
|
||||||
<p>Temps écoulé : {{ count / 2 }} secondes</p>
|
<p>Temps écoulé : {{ count / 2 }} secondes</p>
|
||||||
|
|
@ -11,6 +11,7 @@ import { TaskService } from '../../service/task.service';
|
||||||
})
|
})
|
||||||
export class HomeComponent {
|
export class HomeComponent {
|
||||||
protected count = 0;
|
protected count = 0;
|
||||||
|
private intervalId: any;
|
||||||
|
|
||||||
tasks$!: ReturnType<TaskService['getTasks']>;
|
tasks$!: ReturnType<TaskService['getTasks']>;
|
||||||
|
|
||||||
|
|
@ -19,10 +20,15 @@ export class HomeComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
setInterval(() => {
|
this.intervalId = setInterval(() => {
|
||||||
this.count++;
|
this.count++;
|
||||||
console.log(this.count);
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
if (this.intervalId) {
|
||||||
|
clearInterval(this.intervalId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue