Skip to content

Docs use new Firebase which doesn't exist in beta.2 #341

@Splaktar

Description

@Splaktar

As far as I understand, new Firebase() isn't part of the API anymore in beta.2. If you try it, you will get Cannot find name 'Firebase'.

https://github.com/angular/angularfire2/blob/master/docs/2-retrieving-data-as-objects.md says:

Create an object binding

Data is retrieved through the af.database service.

There are three ways to create an object binding:

  1. Relative URL
  2. Absolute URL
  3. Reference or Query
// relative URL, uses the database url provided in bootstrap
const relative = af.database.object('/item');
// absolute URL
const absolute = af.database.object('https://<your-app>.firebaseio.com/item');
// database reference
const dbRef = new Firebase('https://<your-app>.firebaseio.com/item');
const relative = af.database.object(dbRef);

Later it says that querying objects doesn't exist either:

Querying?

The FirebaseObjectObservable synchronizes objects from the realtime database. There is no querying available for objects because
objects are simply JSON, and JSON order is specified by the browser.

https://github.com/angular/angularfire2/blob/master/docs/3-retrieving-data-as-lists.md says:

Create a list binding

Data is retrieved through the af.database service.

There are three ways to create an object binding:

  1. Relative URL
  2. Absolute URL
  3. Reference
  4. Query
// relative URL, uses the database url provided in bootstrap
const relative = af.database.list('/items');
// absolute URL
const absolute = af.database.list('https://<your-app>.firebaseio.com/items');
// database reference
const dbRef = new Firebase('https://<your-app>.firebaseio.com/items');
const relative = af.database.list(dbRef);
// query 
const dbQuery = new Firebase('https://<your-app>.firebaseio.com/items').limitToLast(10);
const queryList = af.database.list(dbQuery);

So it seems like https://github.com/angular/angularfire2/blob/master/docs/2-retrieving-data-as-objects.md should say:

Create an object binding

Data is retrieved through the af.database service.

There are two ways to create an object binding:

  1. Relative URL
  2. Absolute URL
// relative URL, uses the database url provided in bootstrap
const relative = af.database.object('/item');
// absolute URL
const absolute = af.database.object('https://<your-app>.firebaseio.com/item');

And https://github.com/angular/angularfire2/blob/master/docs/3-retrieving-data-as-lists.md should say:

Create a list binding

Data is retrieved through the af.database service.

There are three ways to create an object binding:

  1. Relative URL
  2. Absolute URL
  3. Query
// relative URL, uses the database url provided in bootstrap
const relative = af.database.list('/items');
// absolute URL
const absolute = af.database.list('https://<your-app>.firebaseio.com/items');
// query 
const queryList = af.database.list('/items', {
  query: {
    limitToLast: 10,
    orderByKey: true
  }
});

Is there some other Reference style of binding that I'm missing that needs to go into the docs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions