Angular 2 NgModel doesn't work
问题 I'm starting my transition from Angular 1 to Angular 2. I tried to do simple things first so I wrote a component: import {Component} from 'angular2/core'; import {NgModel} from 'angular2/common'; @Component({ selector: 'app', template: ` <div> <div>Value is {{ value }}</div> <input type="text" [(ngModel)]="value" /> </div> `, directives: [NgModel] }) export class App { value: string; }; <!DOCTYPE html> <html> <head> <title>Angular2</title> </head> <body> <app></app> <script src="./js/bundle