+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted. In fact, I think I'll say
+ these exact same things again a few times.
+
+
+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted. In fact, I think I'll say
+ these exact same things again a few times.
+
+
+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted.
+
- Angular is my favorite framework, and this is why. Angular has the
- coolest deferrable view feature that makes defer loading content the
- easiest and most ergonomic it could possibly be. The Angular community
- is also filled with amazing contributors and experts that create
- excellent content. The community is welcoming and friendly, and it
- really is the best community out there.
-
-
- I can't express enough how much I enjoy working with Angular. It offers
- the best developer experience I've ever had. I love that the Angular
- team puts their developers first and takes care to make us very happy.
- They genuinely want Angular to be the best framework it can be, and
- they're doing such an amazing job at it, too. This statement comes from
- my heart and is not at all copied and pasted. In fact, I think I'll say
- these exact same things again a few times.
-
-
- Angular is my favorite framework, and this is why. Angular has the
- coolest deferrable view feature that makes defer loading content the
- easiest and most ergonomic it could possibly be. The Angular community
- is also filled with amazing contributors and experts that create
- excellent content. The community is welcoming and friendly, and it
- really is the best community out there.
-
-
- I can't express enough how much I enjoy working with Angular. It offers
- the best developer experience I've ever had. I love that the Angular
- team puts their developers first and takes care to make us very happy.
- They genuinely want Angular to be the best framework it can be, and
- they're doing such an amazing job at it, too. This statement comes from
- my heart and is not at all copied and pasted. In fact, I think I'll say
- these exact same things again a few times.
-
-
- Angular is my favorite framework, and this is why. Angular has the
- coolest deferrable view feature that makes defer loading content the
- easiest and most ergonomic it could possibly be. The Angular community
- is also filled with amazing contributors and experts that create
- excellent content. The community is welcoming and friendly, and it
- really is the best community out there.
-
-
- I can't express enough how much I enjoy working with Angular. It offers
- the best developer experience I've ever had. I love that the Angular
- team puts their developers first and takes care to make us very happy.
- They genuinely want Angular to be the best framework it can be, and
- they're doing such an amazing job at it, too. This statement comes from
- my heart and is not at all copied and pasted.
-
`,
+})
+export class Home {}
diff --git a/src/app/user.component.ts b/src/app/user.component.ts
deleted file mode 100644
index 3d10a19..0000000
--- a/src/app/user.component.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Component, input } from '@angular/core';
-
-@Component({
- selector: 'app-user',
- template: `
The user's name is {{ name() }}
`,
- standalone: true,
-})
-export class User {
- name = input(); // Input property for the user's name
-}
diff --git a/src/app/user/user.component.ts b/src/app/user/user.component.ts
new file mode 100644
index 0000000..5680174
--- /dev/null
+++ b/src/app/user/user.component.ts
@@ -0,0 +1,110 @@
+import { Component } from '@angular/core';
+import { Child } from '../child.component';
+import { Comments } from '../comments.component';
+
+@Component({
+ selector: 'app-user',
+ standalone: true,
+ imports: [Child, Comments],
+ template: `
+
Welcome to the user page!
+
+ @if (isServerRunning) {
+
Yes, the server is running
+ } @else {
+
No, the server is not running
+ }
+
+
Users list :
+ @for (user of users; track user.id) {
+
{{ user.name }}
+ }
+
+
{{ message }}
+
+
This text can be edited
+
+
+
+
+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted. In fact, I think I'll say
+ these exact same things again a few times.
+
+
+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted. In fact, I think I'll say
+ these exact same things again a few times.
+
+
+ Angular is my favorite framework, and this is why. Angular has the
+ coolest deferrable view feature that makes defer loading content the
+ easiest and most ergonomic it could possibly be. The Angular community
+ is also filled with amazing contributors and experts that create
+ excellent content. The community is welcoming and friendly, and it
+ really is the best community out there.
+
+
+ I can't express enough how much I enjoy working with Angular. It offers
+ the best developer experience I've ever had. I love that the Angular
+ team puts their developers first and takes care to make us very happy.
+ They genuinely want Angular to be the best framework it can be, and
+ they're doing such an amazing job at it, too. This statement comes from
+ my heart and is not at all copied and pasted.
+
@@ -77,7 +78,12 @@ import { Comments } from '../comments.component';
my heart and is not at all copied and pasted.
+
+
Your favorite framework is: {{ favoriteFramework }}
@defer (on viewport) {
} @placeholder {
@@ -91,6 +97,7 @@ export class User {
isServerRunning = true;
isEditable = true;
message = '';
+ favoriteFramework = '';
users = [
{ id: 0, name: 'Sarah' },
From 01489da2e0acd1f3693e2d789ee8eac454487552 Mon Sep 17 00:00:00 2001
From: Nathan Python
Date: Thu, 21 Aug 2025 09:06:05 +0200
Subject: [PATCH 14/17] Add functionality to retrieve and display form input
value
---
src/app/user/user.component.ts | 55 +++++++++++++++++++++++-----------
1 file changed, 38 insertions(+), 17 deletions(-)
diff --git a/src/app/user/user.component.ts b/src/app/user/user.component.ts
index 3224763..fd7484b 100644
--- a/src/app/user/user.component.ts
+++ b/src/app/user/user.component.ts
@@ -10,22 +10,26 @@ import { FormsModule } from '@angular/forms';
template: `
Welcome to the user page!
- @if (isServerRunning) {
-
Yes, the server is running
- } @else {
-
No, the server is not running
- }
+
+
+ Yes, the server is running
+
+
No, the server is not running
Users list :
- @for (user of users; track user.id) {
-
{{ user.name }}
- }
+
+
{{ user.name }}
+
{{ message }}
This text can be edited
+
+
Angular is my favorite framework, and this is why. Angular has the
@@ -78,19 +82,23 @@ import { FormsModule } from '@angular/forms';
my heart and is not at all copied and pasted.
+
+
Your favorite framework is: {{ favoriteFramework }}
- @defer (on viewport) {
-
- } @placeholder {
-
Future comments
- } @loading (minimum 2s) {
-
Loading comments...
- }
+
+
+
+
+
+
+
+
Future comments
+
`,
})
export class User {
@@ -98,6 +106,7 @@ export class User {
isEditable = true;
message = '';
favoriteFramework = '';
+ commentsVisible = false;
users = [
{ id: 0, name: 'Sarah' },
@@ -107,11 +116,23 @@ export class User {
{ id: 4, name: 'Poornima' },
];
- onMouseOver() {
- this.message = 'Way to go đ';
+ showFramework() {
+ alert(this.favoriteFramework);
}
addItem(event: string) {
this.users.push({ id: this.users.length, name: event });
}
+
+ trackById(index: number, user: any) {
+ return user.id;
+ }
+
+ loadComments() {
+ this.commentsVisible = true;
+ }
+
+ onMouseOver() {
+ this.message = 'Way to go đ';
+ }
}
From 5839e81fe99ad5044c10c627cfdff48e271f5145 Mon Sep 17 00:00:00 2001
From: Nathan Python
Date: Thu, 21 Aug 2025 09:12:18 +0200
Subject: [PATCH 15/17] Add reactive form for name and email with submit
handling
---
src/app/user/user.component.ts | 45 +++++++++++++++++++++++++++-------
1 file changed, 36 insertions(+), 9 deletions(-)
diff --git a/src/app/user/user.component.ts b/src/app/user/user.component.ts
index fd7484b..4130778 100644
--- a/src/app/user/user.component.ts
+++ b/src/app/user/user.component.ts
@@ -1,22 +1,26 @@
import { Component } from '@angular/core';
import { Child } from '../child.component';
import { Comments } from '../comments.component';
-import { FormsModule } from '@angular/forms';
+import {
+ FormsModule,
+ ReactiveFormsModule,
+ FormGroup,
+ FormControl,
+} from '@angular/forms';
@Component({
selector: 'app-user',
standalone: true,
- imports: [Child, Comments, FormsModule],
+ imports: [Child, Comments, FormsModule, ReactiveFormsModule],
template: `