Skip to content

Commit f811e27

Browse files
committed
fix: missing key on uploads list
1 parent 1e3ba72 commit f811e27

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@angular/platform-browser-dynamic": "^4.4.3",
2424
"@angular/platform-server": "^4.4.3",
2525
"@angular/router": "^4.4.3",
26-
"angularfire2": "^5.0.0-rc.2",
26+
"angularfire2": "^5.0.0-rc.3",
2727
"core-js": "^2.4.1",
2828
"firebase": "^4.4.0",
2929
"lodash": "^4.17.4",

src/app/uploads/shared/upload.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ export class UploadService {
1616

1717

1818
getUploads() {
19-
this.uploads = this.db.list(this.basePath).valueChanges();
19+
this.uploads = this.db.list(this.basePath).snapshotChanges().map(actions => {
20+
return actions.map(a => {
21+
const data = a.payload.val()
22+
const $key = a.payload.key;
23+
return { $key, ...data };
24+
});
25+
});
2026
return this.uploads
2127
}
2228

0 commit comments

Comments
 (0)