Skip to content

Commit dcfdacf

Browse files
Splaktardavideast
authored andcommitted
docs(binding): update syntax for object and list binding (angular#342)
update list query syntax Fixes angular#341
1 parent 26d209d commit dcfdacf

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/2-retrieving-data-as-objects.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,16 @@ export class AppComponent {
3131

3232
Data is retrieved through the `af.database` service.
3333

34-
There are three ways to create an object binding:
34+
There are two ways to create an object binding:
3535

3636
1. Relative URL
37-
2. Absolute URL
38-
3. Reference
37+
1. Absolute URL
3938

4039
```ts
4140
// relative URL, uses the database url provided in bootstrap
4241
const relative = af.database.object('/item');
4342
// absolute URL
4443
const absolute = af.database.object('https://<your-app>.firebaseio.com/item');
45-
// database reference
46-
const dbRef = new Firebase('https://<your-app>.firebaseio.com/item');
47-
const relative = af.database.object(dbRef);
4844
```
4945

5046
### Retrieve data

docs/3-retrieving-data-as-lists.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ Data is retrieved through the `af.database` service.
3232
There are four ways to create an object binding:
3333

3434
1. Relative URL
35-
2. Absolute URL
36-
3. Reference
37-
4. Query
35+
1. Absolute URL
36+
1. Query
3837

3938
```ts
4039
// relative URL, uses the database url provided in bootstrap
4140
const relative = af.database.list('/items');
4241
// absolute URL
4342
const absolute = af.database.list('https://<your-app>.firebaseio.com/items');
44-
// database reference
45-
const dbRef = new Firebase('https://<your-app>.firebaseio.com/items');
46-
const relative = af.database.list(dbRef);
4743
// query
48-
const dbQuery = new Firebase('https://<your-app>.firebaseio.com/items').limitToLast(10);
49-
const queryList = af.database.list(dbQuery);
44+
const queryList = af.database.list('/items', {
45+
query: {
46+
limitToLast: 10,
47+
orderByKey: true
48+
}
49+
});
5050
```
5151

5252
### Retrieve data

0 commit comments

Comments
 (0)