gpt4 book ai didi

firebase - 未知提供者 : $firebaseProvider <- $firebase

转载 作者:行者123 更新时间:2023-12-03 23:52:18 25 4
gpt4 key购买 nike

当尝试将 angularfire 注入(inject)我的应用程序时,我遇到了错误

Error: [$injector:unpr] Unknown provider: $firebaseProvider <- $firebase
http://errors.angularjs.org/1.2.16/$injector/unpr?p0=NaNirebaseProvider%20%3C-%20%24firebase
at http://localhost:9000/bower_components/angular/angular.js:78:12
at http://localhost:9000/bower_components/angular/angular.js:3705:19
at Object.getService [as get] (http://localhost:9000/bower_components/angular/angular.js:3832:39)
at http://localhost:9000/bower_components/angular/angular.js:3710:45
at getService (http://localhost:9000/bower_components/angular/angular.js:3832:39)
at invoke (http://localhost:9000/bower_components/angular/angular.js:3859:13)
at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:3880:23)
at http://localhost:9000/bower_components/angular/angular.js:7134:28
at link (http://localhost:9000/bower_components/angular-route/angular-route.js:913:26)
at nodeLinkFn (http://localhost:9000/bower_components/angular/angular.js:6579:13) angular.js:9778

感觉我已经尝试了所有关于包含 angular firebase 和 angularfire 库的顺序

在我 body 的尽头

  <script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/affix.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/alert.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/button.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/carousel.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/collapse.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/dropdown.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tab.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/transition.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/scrollspy.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/modal.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tooltip.js"></script>
<script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/popover.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/firebase/firebase.js"></script>
<script src="bower_components/firebase-simple-login/firebase-simple-login.js"></script>
<script src="bower_components/angularfire/angularfire.js"></script>
<!-- endbower -->

<!--
<script src='https://cdn.firebase.com/v0/firebase.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/angularFire/0.5.0/angularfire.min.js'></script>
-->

<!-- endbuild -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/about.js"></script>
<!-- endbuild -->

主.js '使用严格';

angular.module('jeetAngFbApp')
.controller('MainCtrl', function ($scope, $firebase) {

var ref = new Firebase('https://aol16tais32.firebaseio-demo.com/');
$scope.messages = $firebase(ref);


$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
});

最佳答案

您需要在模块中包含 firebase。我不确定 jeetAngFbApp 是否是应用程序名称,但类似这样(可能在 app.js 中):

angular.module('jeetAngFbApp', ['firebase'])

.run(function() {
})

.config(function() {
});

关于firebase - 未知提供者 : $firebaseProvider <- $firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24227239/

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