Skip to content

Commit

Permalink
Addking two-way binding supported by FormsModule
Browse files Browse the repository at this point in the history
  • Loading branch information
lorgiorepo committed Sep 9, 2017
1 parent b9a7a12 commit 4386551
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion angular-tour-of-heroes/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class Hero {
<h1>{{title}}</h1>
<h2>{{hero.name}} details!</h2>
<div><label>id: </label>{{hero.id}}</div>
<div><label>name: </label>{{hero.name}}</div>
<div>
<label>name: </label>
<input [(ngModel)]="hero.name" placeholder="name">
</div>
`,
styleUrls: ['./app.component.css']
})
Expand Down
4 changes: 3 additions & 1 deletion angular-tour-of-heroes/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppComponent } from './app.component';

Expand All @@ -8,7 +9,8 @@ import { AppComponent } from './app.component';
AppComponent
],
imports: [
BrowserModule
BrowserModule,
FormsModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down

0 comments on commit 4386551

Please sign in to comment.