如果我使用ng-strict-di
我的 Angular 应用程序并使用该ngRoute
模块,我会收到错误消息:
[Error] Error: [$injector:modulerr] http://errors.angularjs.org/1.4.0-rc.0/$injector/modulerr?p0=epoiApp&p1=%5B%24injector%3Astrictdi%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.4.0-rc.0%2F%24injector%2Fstrictdi%3Fp0%3Dfunction(%2524routeProvider)%0Ahttps%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A6%3A426%0A%24%24annotate%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A182%3A482%0Ae%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A37%3A533%0Ad%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A36%3A238%0Ahttps%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A36%3A358%0An%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A7%3A306%0Ah%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A36%3A135%0A%24a%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A39%3A417%0Ad%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A18%3A383%0Auc%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A19%3A180%0AUd%40https%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A18%3A2%0Ahttps%3A%2F%2Fcode.angularjs.org%2F1.4.0-rc.0%2Fangular.min.js%3A285%3A431%0Afire%40file%3A%2F%2F%2FVolumes%2FMacintosh%2520HD%2FUsers%2FdeLac%2Fsiti%2Fepoi%2FePOI%2Fassets%2Flibs%2Fjquery.js%3A3143%3A35%0AfireWith%40file%3A%2F%2F%2FVolumes%2FMacintosh%2520HD%2FUsers%2FdeLac%2Fsiti%2Fepoi%2FePOI%2Fassets%2Flibs%2Fjquery.js%3A3255%3A11%0Aready%40file%3A%2F%2F%2FVolumes%2FMacintosh%2520HD%2FUsers%2FdeLac%2Fsiti%2Fepoi%2FePOI%2Fassets%2Flibs%2Fjquery.js%3A3467%3A24%0Acompleted%40file%3A%2F%2F%2FVolumes%2FMacintosh%2520HD%2FUsers%2FdeLac%2Fsiti%2Fepoi%2FePOI%2Fassets%2Flibs%2Fjquery.js%3A3498%3A15
(anonymous function) (angular.min.js, line 37)
n (angular.min.js, line 7)
h (angular.min.js, line 36)
$a (angular.min.js, line 39)
d (angular.min.js, line 18)
uc (angular.min.js, line 19)
Ud (angular.min.js, line 18)
(anonymous function) (angular.min.js, line 285)
fire (jquery.js, line 3143)
fireWith (jquery.js, line 3255)
ready (jquery.js, line 3467)
completed (jquery.js, line 3498)
这对我来说很奇怪,因为ngRoute
它是 Angular 的官方模块,不是吗?有没有办法仍然一起使用它们?
我已经包含了 angular-route.min.js
<script src="https://code.angularjs.org/1.4.0-rc.0/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.0-rc.0/angular-route.min.js"></script>