Angularfire2 + firebase or just firbase (without angularfire2)

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.

3 Likes

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.

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?

1 Like

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

npm install rxjs@5.0.1 firebase angularfire2 --save

Thanks

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 ?

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

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…