Angularfire2 + firebase or just firbase (without angularfire2)


#1

Hello,
i just recently started making apps with ionic 2 and wanted to use firebase. i started looking for tutorials and found some which use angularfire2 and firebase, others with just firebase(with no angularfire2). i want to know what is the difference between two methods and i would like to know which is the better of two. And also i would like to use all the features of firebase that are possible to use in the app(like auth, notification, cloud messaging, dynamic links etc).

Thanks for reading through and helping me.


#2

I’m trying but I’m getting this error:

npm install angularfire2 --save
ionic-hello-world@ /Users/sovide/dev/timepix/timepix-fe
├── angularfire2@2.0.0-beta.7
└── UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12

npm WARN angularfire2@2.0.0-beta.7 requires a peer of rxjs@^5.0.1 but none was installed.

#3

Two things:

  1. You can just import AngularFire, without importing anything from Firebase. At least right now. That;'s changed a bit over time, and AF is still in beta, so it might change again.

  2. You can use npm to install rxjs 5.0.1. You need rxjs 5 for Angular 2. Are you running the newest Ionic version?


#4

Done. Using the latests Ionic, I’m not getting dependencies error anymore:

npm install rxjs@5.0.1 firebase angularfire2 --save

Thanks


#5

actually, after npm install rxjs@5.0.1 firebase angularfire2 --save I’ve deleted node_modules and then run npm install

this is what I get:

...
...
│ ├── localforage-cordovasqlitedriver@1.5.0
│ └── UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12
├── angularfire2@2.0.0-beta.7
├─┬ firebase@3.6.6
...
...
├── ionicons@3.0.0
├─┬ UNMET PEER DEPENDENCY rxjs@5.0.3
│ └── symbol-observable@1.0.4
...
...

any deas ?


#6

Is it causing a problem? Everything is in beta, so warnings aren’t surprising.


#7

You are right. I’ll wait until when out of beta. In the mean time I’m using firebase without angularefire for now… I just need it for authentication…