Skip to content

Commit c620659

Browse files
jamesdanielsdavideast
authored andcommitted
Module, next step, and code format
1 parent 50dfb71 commit c620659

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# 3. Retrieving data as lists
22

33
> AngularFire2 synchronizes data as lists using the `FirebaseListObservable`.
4-
The `FirebaseListObservable` is not created by itself, but through the `AngularFire.database` service.
4+
The `FirebaseListObservable` is not created by itself, but through the `AngularFire.database` module.
55
The guide below demonstrates how to retrieve, save, and remove data as lists.
66

7-
## Injecting the AngularFire service
7+
## Injecting the AngularFireDatabase module
88

99
**Make sure you have bootstrapped your application for AngularFire2. See the Installation guide for bootstrap setup.**
1010

11-
AngularFire is an injectable service, which is injected through the constructor of your Angular component or `@Injectable()` service.
11+
AngularFireDatabase is an injectable module, which is injected through the constructor of your Angular component or `@Injectable()` service.
1212
In the previous step, we modified the `/src/app/app.component.ts` to retrieve data as object. In this step, let's start with a clean slate.
1313

1414
Replace your `/src/app/app.component.ts` from previous step to look like below.
@@ -92,9 +92,9 @@ The table below highlights some of the common methods on the `FirebaseListObserv
9292

9393
| method | |
9494
| ---------|--------------------|
95-
| push(value: any) | Creates a new record on the list, using the Realtime Database's push-ids. |
96-
| update(keyRefOrSnap: string) | Firebase | AFUnwrappedSnapshot, value: Object) | Updates an existing item in the array. Accepts a key, database reference, or an unwrapped snapshot. |
97-
| remove(key: string?) | Deletes the item by key. If no parameter is provided, the entire list will be deleted. |
95+
| `push(value: any)` | Creates a new record on the list, using the Realtime Database's push-ids. |
96+
| `update(keyRefOrSnap: string)` | Firebase | AFUnwrappedSnapshot, value: Object) | Updates an existing item in the array. Accepts a key, database reference, or an unwrapped snapshot. |
97+
| `remove(key: string?)` | Deletes the item by key. If no parameter is provided, the entire list will be deleted. |
9898

9999
## Returning promises
100100
Each data operation method in the table above returns a promise. However,
@@ -194,8 +194,8 @@ Data retrieved from the object binding contains special properties retrieved fro
194194

195195
| property | |
196196
| ---------|--------------------|
197-
| $key | The key for each record. This is equivalent to each record's path in our database as it would be returned by `ref.key()`.|
198-
| $value | If the data for this child node is a primitive (number, string, or boolean), then the record itself will still be an object. The primitive value will be stored under `$value` and can be changed and saved like any other field.|
197+
| `$key` | The key for each record. This is equivalent to each record's path in our database as it would be returned by `ref.key()`.|
198+
| `$value` | If the data for this child node is a primitive (number, string, or boolean), then the record itself will still be an object. The primitive value will be stored under `$value` and can be changed and saved like any other field.|
199199

200200
## Retrieving the snapshot
201201
AngularFire2 unwraps the Firebase DataSnapshot by default, but you can get the data as the original snapshot by specifying the `preserveSnapshot` option.
@@ -211,4 +211,4 @@ this.items
211211
})
212212
```
213213

214-
###[Next Step: Querying lists](4-querying-lists.md)
214+
### [Next Step: Querying lists](4-querying-lists.md)

0 commit comments

Comments
 (0)