Creates a new FirebaseService using the given Firebase JavaScript API Object.
Either the FirebaseConfig or Firebase instance that the service should use.
Gets an observable that resolves whenever a child is added to this Firebase location. Internally, this maps to the 'child_added' event emitted by Firebase.
Gets the raw event stream for the 'child_added' event from the underlying Firebase Object.
Gets an observable that resolves whenever the data of a child in this Firebase location is modified. Internally, this maps to the 'child_changed' event emitted by Firebase.
Gets the raw event stream for the 'child_changed' event from the underlying Firebase Object.
Gets an observable that resolves whenever a child is moved in this Firebase location. Internally, this maps to the 'child_moved' event emitted by Firebase.
Gets the raw event stream for the 'child_moved' event from the underlying Firebase Object.
Gets an observable that resolves whenever a child is removed from this Firebase location. Internally, this maps to the 'child_removed' event emitted by Firebase.
Gets the raw event stream for the 'child_removed' event from the underlying Firebase Object.
Gets an observable that resolves with the data in this Firebase location and whenever the data is updated. Semantically the same as calling .value. Internally, this maps to the 'value' event emitted by Firebase.
Alias for .valueRaw.
Gets the internal Firebase Instance.
Gets an observable that resolves with the value in this Firebase location and whenever the data is updated. Internally, this maps to the 'value' event emitted by Firebase.
Gets the raw event stream for the 'value' event from the underlying Firebase Object.
Wraps this FirebaseService in a new FirebaseArray object. The FirebaseArray service provides functionality for dealing with synchronized order lists of objects.
Gets a child Firebase service that represents the data at the given path.
The relative path from this Firebase location to the requested location.
Retrieves an observable that wraps the given event from the Firebase API.
One of the following strings: "value", "child_added", "child_changed", "child_removed", or "child_moved."
An object that represents the asynchronous stream of events.
Adds the given data to this Firebase location.
The data that should be added.
Removes the child with the given key from this location. If a key is not provided, then this location will be removed from it's parent location.
The key of the child that should be removed from this location.
Sets the data exact data that this Firebase location should contain and returns an observable that represents the operation.
The data that should be set to this location.
Returns a promise that resolves true
if the data was set. Otherwise the promise rejects if there was an error.
Update the objects children in this Firebase location. Passing null to updateData() will remove the value at the specified location. returns an promise that resolves when the operation is succesfull.
The object containing only the keys that should be updated in this location.
Returns a promise that resolves true
if the data was succesfully updated. Otherwise the promise rejects if there was an error.
Wraps the given Firebase event type as an observable.
One of the following strings: "value", "child_added", "child_changed", "child_removed", or "child_moved."
Generated using TypeDoc
Defines a service that wraps the Firebase Javascript API in a nice, Observable-enabled manner.
Example:
import {FirebaseService} from 'ng2-firebase/core'; // Tell TypeScript that the Firebase SDK has created a global for us declare var Firebase; var firebase = new FirebaseService( new Firebase('https://YOUR-FIREBASE-URL.firebaseio-demo.com') ); // Use Service
Angular 2 Example:
// some.component.ts import { Component, OnInit, provide } from 'angular2/core'; import { FirebaseService, FirebaseServiceFactory } from 'ng2-firebase/core'; import { Observable } from 'rxjs/Rx'; @@Component({ // FirebaseServiceFactory is not Implemented yet... selector: 'some-component', // Make sure to include the async pipe so that the most recent value // is resolved from the data observable. template: 'My Data: {{data | async}}', // Declare the providers that should be used for the service. providers: [ provide(FirebaseService, { useFactory: FirebaseServiceFactory }) ] }) export class SomeComponent implements OnInit { private firebase: FirebaseService; data: Observable<any>; constructor(firebase: FirebaseService) { this.firebase = firebase; } observeData() { this.data = this.firebase.data; } ngOnInit() { this.observeData(); } }