From dfa54c9f5038355d68a9cec4eec4ecf119a52eba Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Sun, 15 Jul 2018 12:48:24 -0400 Subject: [PATCH] Added sorting (Fixes #15) --- src/app/formulaManager/formulaManager.component.ts | 2 +- src/app/store/categories.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/formulaManager/formulaManager.component.ts b/src/app/formulaManager/formulaManager.component.ts index 7d0bb8e..2a53d92 100644 --- a/src/app/formulaManager/formulaManager.component.ts +++ b/src/app/formulaManager/formulaManager.component.ts @@ -27,7 +27,7 @@ export class FormulaManagerComponent { } constructor(private db: AngularFirestore, public electron: ElectronService) { - this.formulas = this.db.collection('formulas').valueChanges(); + this.formulas = this.db.collection('formulas', ref => ref.orderBy('name')).valueChanges(); } displayFormula(formula) { diff --git a/src/app/store/categories.component.ts b/src/app/store/categories.component.ts index 668d913..5c42b9d 100644 --- a/src/app/store/categories.component.ts +++ b/src/app/store/categories.component.ts @@ -34,7 +34,7 @@ export class CategoriesComponent { if (!this.category) this.breadcrumb.clear(); this.categories = this.db - .collection('categories') + .collection('categories', ref => ref.orderBy('name')) .valueChanges() .pipe( map(rows =>