Angular报错记录 - Can't bind to 'ngModel' since it isn't a known property of 'input'

在angular中使用ngModel做双向数据绑定报错:

ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'input'.

原因:模块中没有导入FormsModule

import {FormsModule} from '@angular/forms';

你可能感兴趣的:(Angular报错记录 - Can't bind to 'ngModel' since it isn't a known property of 'input')