Creates a new FirebaseArray using the given FirebaseService.
Whether inner array should be copied when notifying observers. Defaults to true.
Gets the array that is currently stored in this service.
Gets an observable for the length of the array.
Gets an observable that notifies whenever the underlying array is updated.
Gets the underlying service for this array.
Applies the child_added event handler logic to the arrays.
Applies the child_moved event handler logic to the given array.
Applies the child_moved event handler logic to the given array.
Applies the child_removed event handler logic to the arrays.
Adds the given data to the end of this array. Returns a promise that represents the async operation.
The data that should be added to the data structure.
Filters each of the elements in the observed arrays based on whether they match the provided comparison function.
Returns an observable that resolves whenever a new value is found in the underlying array.
If the value was removed, or was originally not present in the array, undefined
is returned.
The function that is used to determine if a value is "found".
The object that the callback should be called on.
Returns an observable that resolves with the index of the item whenever a new value is found in the underlying array.
If the value was removed, or was originally not present in the array, -1
is returned.
The function that is used to determine if a value is "found".
The object that the callback should be called on.
Gets an observable that resolves whenever the index of the given value is found.
Gets an observable that resolves with the index of the given key is found.
Maps each observed array to a new array that is made up of the results of calling the given callback function.
Removes the child at the given index(a.k.a. key) from this array.
The key of the child that should be removed from the data structure.
Sets the data stored at the given index (a.k.a. key).
The key of the child whose data should be replaced.
The data that the child should be replaced with.
Registers handlers for notification when this array is updated.
Moves the value in the given array at the given position to the given new position.
Generated using TypeDoc
Defines a class that provides capabilities to synchronize ordered lists for a Firebase Object.
Example:
import {FirebaseService} from 'ng2-firebase/core'; // Get the Array var arr = new FirebaseService( new Firebase('https://YOUR-FIREBASE-URL.firebaseio-demo.com') ).asArray(); // Use Array
Angular 2 Example:
// some.component.ts import { Component, OnInit, provide } from 'angular2/core'; import { FirebaseArray, 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: 'I have {{users.length}} users!' + '<div *ngFor="#user of (users.observable | async)">' + ' {{user.name}}' + '</div>' + '<h2>Users over 18:</h2>' + '<div *ngFor="#user of (over18 | async)>' + ' {{user.name}}' + '</div>' +, // Declare the providers that should be used for the service. providers: [ provide( FirebaseArray, { useValue: new FirebaseService( new Firebase('https://YOUR-FIREBASE-URL.firebaseio-demo.com') ).asArray() } ) ] }) export class SomeComponent implements OnInit { private users: FirebaseArray; private over18: Observable<User>; constructor(users: FirebaseArray) { this.users = users; } findOver18(): Observable<User> { this.over18 = this.users.filter(u => u.age > 18); } ngOnInit() { findOver18(); } }