e) Edit the hero + AppModule
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
+import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HeroesComponent } from './heroes/heroes.component';
HeroesComponent
],
imports: [
- BrowserModule
+ BrowserModule,
+ FormsModule
],
providers: [],
bootstrap: [AppComponent]
<h2>{{hero.name | uppercase}} Details</h2>
<div><span>id: </span>{{hero.id}}</div>
-<div><span>name: </span>{{hero.name}}</div>
+<div>
+ <label>name: </label>
+ <input [(ngModel)]="hero.name" placeholder="Type a name..." />
+</div>