3
votes

The AngularFire2 example https://github.com/angular/angularfire2

is a single component which imports: import { AngularFire, FirebaseListObservable } from 'angularfire2';

I'm assuming in a multi-component app, this would be done just once (in a service) and then all the Firebase access is through that service. Yes?

Or is there no overhead/duplication issues with having each component having direct access to Firebase ie. AngularFire manages that.

1

1 Answers

0
votes

Ideally yes as far as I understand, you should '.map' the 'FirebaseObjectObservable' or 'FirebaseListObservable' into your own objects. 'FirebaseObjectObservable' should be mapped to 'Observable' so that components don't care about the fire base dependency.