Firebase、AngularFire 错误:模块 firebase 不可用 [英] Firebase, AngularFire Error: Module firebase is not available

查看:35
本文介绍了Firebase、AngularFire 错误:模块 firebase 不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的 Yeoman AngularJS 应用程序设置 firebase、angularfire.我在这里遵循了本教程(https://www.firebase.com/tutorial/#tutorial/angular/0) 但我一直收到一个

I am trying to setup firebase, angularfire for my Yeoman, AngularJS Application. I followed this tutorial here (https://www.firebase.com/tutorial/#tutorial/angular/0) but I keep getting a

Uncaught Error: [$injector:modulerr] Failed to instantiate module MyApp due to:
Error: [$injector:modulerr] Failed to instantiate module firebase due to:
Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the m...<omitted>...1)

我该如何解决这个问题?

How do I get past this?

我相信教程中的这两行说它为我们下载了 firebase,但我可能把它放在了错误的地方.我试着把它放在 head 标签之间,就在凉亭组件旁边,以及我所有的脚本旁边

I believe it is these two line from the tutorial which says it downloads firebase for us but I might be putting it in the wrong place. I tried putting it inbetween the head tags, right by the bower components, as well as next to all my scripts

<script src='https://cdn.firebase.com/js/client/1.0.15/firebase.js'></script>
<script src='https://cdn.firebase.com/libs/angularfire/0.8.0/angularfire.min.js'></script>

推荐答案

我遇到了这个问题,发现加载 firebase,然后是 angular,然后是 angularfire 工作正常.像这样

I had this issue and found that loading firebase, then angular, then angularfire worked fine. Like this

<head>
  <script src="https://cdn.firebase.com/js/client/2.2.2/firebase.js"></script>
  <script src="js/app.js"></script>
  <script src="js/controllers.js"></script>
  <script src="js/services.js"></script>
  <script src="https://cdn.firebase.com/libs/angularfire/1.0.0/angularfire.min.js"></script>
</head>

这篇关于Firebase、AngularFire 错误:模块 firebase 不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆