angularJS 常见错误之ngModel:nonassign

来源:互联网 发布:淘宝客大群 编辑:程序博客网 时间:2024/06/18 15:20

错误内容如下:

angular.js:14199 Error: [ngModel:nonassign] Expression '' is non-assignable. Element: <input class="ng-pristine ng-untouched ng-valid" ng-model="">
http://errors.angularjs.org/1.5.11/ngModel/nonassign?p0=&p1=%3Cinputlass%3D%22ng-pristine%20ng-untouched%20ng-valid%22%20ng-model%3D%22%22%3E
    at http://localhost:3000/bower_components/angular/angular.js:68:12
    at NgModelController.$$setOptions (http://localhost:3000/bower_components/angular/angular.js:27915:13)
    at Object.ngModelPreLink (http://localhost:3000/bower_components/angular/angular.js:28742:21)
    at http://localhost:3000/bower_components/angular/angular.js:1259:18
    at invokeLinkFn (http://localhost:3000/bower_components/angular/angular.js:10152:9)
    at nodeLinkFn (http://localhost:3000/bower_components/angular/angular.js:9528:11)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8810:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8813:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8813:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8813:13)


截图如下:


可以根据提示看出是元素<input class="ng-pristine ng-untouched ng-valid" ng-model="">中一个表达没有意义。

原因是ng-model=""这里不可以为空

0 0