Skip to content

Commit 844c096

Browse files
orahul1jamesdaniels
authored andcommitted
docs(rtdb): update the snapshotChanges example (angular#1224)
1 parent 0f6f2bf commit 844c096

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/rtdb/lists.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ There are four child events: `"child_added"`, `"child_changed"`, `"child_removed
110110

111111
```ts
112112
this.itemsRef = db.list('items');
113-
this.items.snapshotChanges(['child_added'])
114-
.subscribe(action => {
113+
this.itemsRef.snapshotChanges(['child_added'])
114+
.subscribe(actions => {
115115
actions.forEach(action => {
116116
console.log(action.type);
117-
console.log(action.snapshot.key)
118-
console.log(action.snapshot.val())
117+
console.log(action.key);
118+
console.log(action.payload.val());
119119
});
120-
})
120+
});
121121
```
122122

123123
## Saving data

0 commit comments

Comments
 (0)