美文网首页我爱编程
Angular报错记录 - Can't bind to 'ngM

Angular报错记录 - Can't bind to 'ngM

作者: 飞鱼YE | 来源:发表于2018-04-18 19:35 被阅读0次

    在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 'ngM

        本文链接:https://www.haomeiwen.com/subject/dzsbkftx.html