Skip to content

Commit 486eaa8

Browse files
jamesdanielsdavideast
authored andcommitted
AngularFireDatabase module + code formatting
1 parent e04d0d5 commit 486eaa8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
The `FirebaseObjectObservable` is not created by itself, but through the `AngularFire.database` service.
55
The guide below demonstrates how to retrieve, save, and remove data as objects.
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 @NgModule, which is injected through the constructor of your Angular component or `@Injectable()` service.
1212

1313
If you've followed the earlier step "Installation and Setup" your `/src/app/app.component.ts` should look like below.
1414

@@ -81,9 +81,9 @@ The table below highlights some of the common methods on the `FirebaseObjectObse
8181

8282
| method | |
8383
| ---------|--------------------|
84-
| set(value: any) | Replaces the current value in the database with the new value specified as the parameter. This is called a **destructive** update, because it deletes everything currently in place and saves the new value. |
85-
| update(value: Object) | Updates the current value with in the database with the new value specified as the parameter. This is called a **non-destructive** update, because it only updates the values specified. |
86-
| remove() | Deletes all data present at that location. Same as calling `set(null)`. |
84+
| `set(value: any)` | Replaces the current value in the database with the new value specified as the parameter. This is called a **destructive** update, because it deletes everything currently in place and saves the new value. |
85+
| `update(value: Object)` | Updates the current value with in the database with the new value specified as the parameter. This is called a **non-destructive** update, because it only updates the values specified. |
86+
| `remove()` | Deletes all data present at that location. Same as calling `set(null)`. |
8787

8888
## Returning promises
8989
Each data operation method in the table above returns a promise. However,
@@ -169,8 +169,8 @@ Data retrieved from the object binding contains special properties retrieved fro
169169

170170
| property | |
171171
| ---------|--------------------|
172-
| $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()`.|
173-
| $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.|
172+
| `$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()`.|
173+
| `$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.|
174174

175175

176176
## Retrieving the snapshot

0 commit comments

Comments
 (0)