Bruce Phillips
Bruce Phillips

Reputation: 2790

Angular 2 Tour of Heroes Tutorial Two Way Binding

I've started to learn Angular 2 and am working my way through the Tour of Heroes Tutorial here: https://angular.io/docs/ts/latest/tutorial/toh-pt1.html

Everything is working fine until I get to the two way binding part.

After I make the changes called for in this section I just get Loading... on my web page.

If I change this line

<input [(ngModel)]="hero.name" placeholder="name">

back to

<input value="{{hero.name}}" placeholder="name">

Then the page works and I see the input text box with Windstorm as the value.

I've doubled checked my files and copied the code directly from the tutorial into my IDE.

I'm working on a Mac and using node version 4.2.4 and npm version 2.4.12

Upvotes: 1

Views: 395

Answers (1)

Bruce Phillips
Bruce Phillips

Reputation: 2790

My mistake - I had not saved the app.module.ts file after adding the import {FormsModule} from '@angular/forms';

Upvotes: 1

Related Questions