Skip to content

Commit 6b3548f

Browse files
jek-bao-choodavideast
authored andcommitted
docs: update Developer Guide to have consistency (angular#194)
Minor inconsistency of naming. Moreover, including an explanation for item.$value and its relevant data structure would aid learners.
1 parent d27bb17 commit 6b3548f

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

docs/1-install-and-setup.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ bootstrap(<MyApp>, [
112112

113113
### 8. Inject AngularFire
114114

115-
Open `/src/app/<project-name>.component.ts`:
115+
Open `/src/app/<my-app>.component.ts`:
116116

117117
```ts
118118
import { Component } from '@angular/core';
@@ -134,7 +134,7 @@ export class <MyApp>Component {
134134

135135
### 9. Bind to a list
136136

137-
In `/src/app/project-name.component.ts`:
137+
In `/src/app/<my-app>.component.ts`:
138138

139139
```ts
140140
import { Component } from '@angular/core';
@@ -146,7 +146,7 @@ import { AngularFire, FirebaseListObservable } from 'angularfire2';
146146
templateUrl: '<my-app>.component.html',
147147
styleUrls: ['<my-app>.component.css']
148148
})
149-
export class RcTestAppComponent {
149+
export class <MyApp>Component {
150150
items: FirebaseListObservable<any[]>;
151151
constructor(af: AngularFire) {
152152
this.items = af.database.list('/items');
@@ -165,7 +165,19 @@ Open `/src/app/<my-app>.component.html`:
165165
```
166166

167167
The `async` pipe unwraps the each item in the people
168-
observable as they arrive.
168+
observable as they arrive. Also the array that is received through the `items` observable contains objects that have a `$value` property. A structure like this:
169+
```
170+
[
171+
{
172+
$value: 'something',
173+
(...)
174+
},
175+
{
176+
$value: 'something else',
177+
(...)
178+
},
179+
]
180+
```
169181

170182
### 10. Serve
171183

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import {AngularFire, FirebaseObjectObservable} from 'angularfire2';
6363
`,
6464
})
6565
export class AppComponent {
66-
item: Observable<any>;
66+
item: FirebaseObjectObservable<any>;
6767
constructor(af: AngularFire) {
6868
this.item = af.database.object('/item');
6969
}

0 commit comments

Comments
 (0)