Uncaught Error: [$injector:modulerr]
程序员文章站
2022-04-17 15:32:25
...
1、错误描述
2、错误原因
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script> </head> <body> <p ng-app="app" ng-controller="appCon"> <input type="text" ng-model="username" /> <label>{{username}}</label> </p> </body> </html>
在编写AngularJS中的ng-model指令实例时,添加了ng-controller,预览页面时出现这个错误;将ng-controller指令去掉,就不报这个错误。
是由于ng-controller指令错误使用导致出错,ng-app指令里不能有值
3、解决办法
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script> </head> <body> <p ng-app=""> <input type="text" ng-model="username" /> <label>{{username}}</label> </p> </body> </html>
将ng-controller指令去掉,ng-app指令值置空
以上就是Uncaught Error: [$injector:modulerr]的内容,更多相关内容请关注PHP中文网(www.php.cn)!
推荐阅读
-
jQuery的$.get()函数不执行以及php端报错Uncaught Error: Call to a member function bind_param() on boolean in...
-
Uncaught (in promise) Error: Request failed with status code 415
-
Uncaught Error: Call to undefined function imageCreateTruecolor() in ,php7中GD库打不开
-
Uncaught (in promise) Error: Minified React error #31
-
解决echarts地图geoJson报错问题(“echarts.min.js:45 Uncaught Error: Invalid geoJson format Cannot read prope”)
-
PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syn
-
又拍云存储 - 使用php-sdk-master删除图片报错Fatal error: Uncaught UpYunException:
-
Uncaught transport.js/parseResult() error: can't parse to JSON.
-
php soap异常 Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Err
-
VUE 登录不上,F12报错Uncaught (in promise) Error: Request failed with status code 404