gpt4 book ai didi

javascript - 如何修复未知提供程序 : locationProvider

转载 作者:行者123 更新时间:2023-11-29 17:01:25 26 4
gpt4 key购买 nike

我将代码编写为我的 Angular Controller ,如下所示:

.config(function($routeProvider, $locationProvider, $httpProvider) ,

但我总是得到这个错误:

angular.js:9193 Error: [$injector:unpr] Unknown provider: locationProvider <- location <- activeNavDirectivehttp://errors.angularjs.org/1.2.3/$injector/unpr?p0=locationProvider%20%3C-%20location%20%3C-%20activeNavDirective    at 
/js/bower_components/angular/angular.js:78:12 at
/js/bower_components/angular/angular.js:3473:19 at Object.getService [as get]
/js/bower_components/angular/angular.js:3600:39) at
/js/bower_components/angular/angular.js:3478:45 at getService
/js/bower_components/angular/angular.js:3600:39) at Object.invoke
/js/bower_components/angular/angular.js:3622:13) at
/js/bower_components/angular/angular.js:5146:43 at Array.forEach (native) at forEach
/js/bower_components/angular/angular.js:300:11) at Object.<anonymous>
(xxxxx/js/bower_components/angular/angular.js:5144:13)angular.js:9193 (anonymous function)

最佳答案

您似乎在某个地方使用了没有 $ 前缀 locationProvider$locationProvider。你能检查一下吗。

关于javascript - 如何修复未知提供程序 : locationProvider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27476443/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com