import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, FormsModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div>
<label for="name">Name:</label>
<input id="name" [(ngModel)]="name" />
<p>Hello, {{ name }}!</p>
</div>
`,
})
export class AppComponent {
name: string = '';
}