|
4 | 4 | The `FirebaseObjectObservable` is not created by itself, but through the `AngularFire.database` service. |
5 | 5 | The guide below demonstrates how to retrieve, save, and remove data as objects. |
6 | 6 |
|
7 | | -## Injecting the AngularFire service |
| 7 | +## Injecting the AngularFireDatabase module |
8 | 8 |
|
9 | 9 | **Make sure you have bootstrapped your application for AngularFire2. See the Installation guide for bootstrap setup.** |
10 | 10 |
|
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. |
12 | 12 |
|
13 | 13 | If you've followed the earlier step "Installation and Setup" your `/src/app/app.component.ts` should look like below. |
14 | 14 |
|
@@ -81,9 +81,9 @@ The table below highlights some of the common methods on the `FirebaseObjectObse |
81 | 81 |
|
82 | 82 | | method | | |
83 | 83 | | ---------|--------------------| |
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)`. | |
87 | 87 |
|
88 | 88 | ## Returning promises |
89 | 89 | 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 |
169 | 169 |
|
170 | 170 | | property | | |
171 | 171 | | ---------|--------------------| |
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.| |
174 | 174 |
|
175 | 175 |
|
176 | 176 | ## Retrieving the snapshot |
|
0 commit comments