Beginner with firebase

Asked

Viewed 332 times

3

I want to implement firebase in my app (Ionic).

index

app

controller

When I test a message:

Unknown Provider: $firebaseArrayProvider <- $firebaseArray <- Loginctrl

  1. Should I declare my firebase settings in the "app" or "index"? I’ve seen of the two ways to do on the web.
  2. I would like to create a table containing the user information in firebase as: email, name, password, registration info in general.
  3. Each user would have related their respective accounts their sent and received messages.

Guys, help me, I’ve read a lot about it but I’m really struggling with this part!

  • you injected Firebase into your app.js?

  • Good afternoon @Diegoaugusto, inject would install and in the project and link? I’ve done this already. :(

  • Injecting would be that: angular.module('myApp', ['firebase'])

  • I’ve done that already! angular.module('starter', [&#xA; 'ionic', 'ngCordova', 'firebase',...

  • Already tried to update angularFire library?

  • Try changing your angular-fire statement in index.html to this: <script src="https://cdn.firebase.com/libs/angularfire/2.1.0/angularfire.min.js"></script> and see if it works

  • I downloaded yesterday through "npm install" the angularfire and firebase. I copied angularfire.min.js and firebase.js to my project JS folder. I believe it is updated right?

  • I changed my statement and it appeared this: Ionic.bundle.js:13441 Uncaught Error:[$injector:modulerr] Failed to instantiate module Starter due to: Error: [$injector:modulerr] Failed to instantiate module firebase due to: Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the Second argument.

  • Not always the latest version is downloaded. According to the documentation just follow these same steps. https://github.com/firebase/angularfire/blob/master/docs/quickstart.md

Show 5 more comments

1 answer

1


You can upgrade the version of angular-fire, probably the version you are using does not support the $firebaseArray.

Try to change the import of your libs to these:

<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/3.3.0/firebase.js"></script>

<!-- AngularFire -->
<script src="https://cdn.firebase.com/libs/angularfire/2.0.1/angularfire.min.js"></script>

If it works you can download the updated libs and import them as before.

I better declare my firebase settings in the "app" or "index"? I saw of the two ways of doing on the web.

I believe this is more a matter of "good practice", I particularly always use in app.js because this way the project becomes more organized

Refrencia: Quickstart | Angularfire

  • 1

    It worked, thank you very much @Diegoaugusto !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.