AngularJS

使用AngularJS后,加载页面后台报错:

Error: [$compile:tpload] http://errors.angularjs.org/1.2.12/$compile/tpload?p0=..%2Fdist%2Fabn_tree_template.html t/<@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:9 ic/this.$get</E/<@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:59 ld/this.$get</r/k.error/<@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:69 zd/e/l.promise.then/H@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:96 zd/e/l.promise.then/H@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:96 zd/e/l.promise.then/H@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:96 zd/h/<.then/<@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:97 Ad/this.$get</h.prototype.$eval@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:105 Ad/this.$get</h.prototype.$digest@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:103 Ad/this.$get</h.prototype.$apply@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:106 f@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:70 H@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:74 od/</C.onreadystatechange@http ://localhost:8081/mideaidm-ess/resources/jquery-1.10.2.min.js:75


谷歌百度得到参考为:

出错原因可能

1. 没有引入angular-route.min.js
2. 没有标明模块 angular.module(‘phonecat’, ['ngRoute'])

结果没能解决问题。我单独测试时,并没有明确引入angular-route.min.js,而出现问题后,即使加入angular-route.min.js也没用。

最后发现,错误原因在于,问题由自己想当然的小聪明导致:ng-app 必须放在html标签中。我把它换了位置,所以错误就出现了。


你可能感兴趣的:(AngularJS,错误处理)