Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions docs/4-querying-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ re-run queries when the observable emits a new value.

This is the magic of AngularFire2.

An RxJS Subject is imported below. A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners. See, [What is a Subject](http://reactivex.io/rxjs/manual/overview.html#subject) for more information.

```ts
const subject = new Subject(); // import {Subject} from 'rxjs/Subject';
const queryObservable = af.database.list('/items', {
Expand Down Expand Up @@ -81,8 +83,7 @@ import { AngularFire, FirebaseListObservable, FirebaseObjectObservable } from 'a
import { Subject } from 'rxjs/Subject';

@Component({
moduleId: module.id,
selector: 'app',
selector: 'app-root',
template: `
<ul>
<li *ngFor="let item of items | async">
Expand All @@ -97,7 +98,7 @@ import { Subject } from 'rxjs/Subject';
</div>
`,
})
export class RcTestAppComponent {
export class AppComponent {
items: FirebaseListObservable<any[]>;
sizeSubject: Subject<any>;

Expand All @@ -116,4 +117,19 @@ export class RcTestAppComponent {
}
```

###[Next Step: User Authentication](5-user-authentication.md)
+**To run the above example as is, you need to have sample data in you firebase database with the following structure:"**

```ts
-|items
-|item1
-|size: small
-|text: sample small text
-|item2
-|size: medium
-|text: sample medium text
-|item3
-|size: large
-|text: sample large text
```

###[Next Step: User Authentication](5-user-authentication.md)