Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit ddbb660

Browse files
Fixed the 'ordered query' example
1 parent 93a50f4 commit ddbb660

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

demo/app/main-view-model.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,14 @@ export class HelloWorldModel extends Observable {
238238
public doWebQueryBulgarianCompanies(): void {
239239
const path = "/companies";
240240
const child = "name";
241-
firebaseWebApi.database().ref(path).orderByChild(child);
241+
firebaseWebApi.database().ref(path).orderByChild(child)
242+
.once("value")
243+
.then(result => {
244+
this.set("path", path);
245+
this.set("key", result.key);
246+
this.set("value", JSON.stringify(result.val()));
247+
})
248+
.catch(error => console.log("doWebQueryBulgarianCompanies error: " + error));
242249
}
243250

244251
public doWebStoreCompanyByFirstCreatingKey(): void {

0 commit comments

Comments
 (0)