是否可以在 ionic 2 中重新排序或编辑我的 firebase 列表?
Is possible to re-sort or edit my firebase list in ionic 2?
我不确定我的问题是否有任何示例,但我想使用任何可能的方法重新排序或编辑我的 firebase 列表。
例如:我有这个 firebase 列表:
public classesList: FirebaseListObservable<any[]>;
...
this.classesList = this.afd.list('/classes/',{
query:{
orderByChild:'uemail',
equalTo: 'user1@gmail.com'
}
})
这是包含 类List
的示例
classesList
-- class1
----- day: 'sun,tus,thu'
----- time: '10:00'
-- class2
----- day: 'sun,thu'
----- time: '8:00'
-- class3
----- day: 'sun,thu'
----- time: '9:00'
我的问题:如何使 "if statements" 在 类 之间重新排序我的列表或推送其他临时数组中的值以在我的 html 中使用它(& 应该我是否为临时数组添加 'async' ?)!
您的 classesList 示例中的 uemail
child 在哪里?
this.afd.list
的输出是 object。 children 匹配查询。您可以按照自己的方式使用 converts an object to an array, and then sort the array 函数。
我不确定我的问题是否有任何示例,但我想使用任何可能的方法重新排序或编辑我的 firebase 列表。
例如:我有这个 firebase 列表:
public classesList: FirebaseListObservable<any[]>;
...
this.classesList = this.afd.list('/classes/',{
query:{
orderByChild:'uemail',
equalTo: 'user1@gmail.com'
}
})
这是包含 类List
的示例classesList
-- class1
----- day: 'sun,tus,thu'
----- time: '10:00'
-- class2
----- day: 'sun,thu'
----- time: '8:00'
-- class3
----- day: 'sun,thu'
----- time: '9:00'
我的问题:如何使 "if statements" 在 类 之间重新排序我的列表或推送其他临时数组中的值以在我的 html 中使用它(& 应该我是否为临时数组添加 'async' ?)!
您的 classesList 示例中的 uemail
child 在哪里?
this.afd.list
的输出是 object。 children 匹配查询。您可以按照自己的方式使用 converts an object to an array, and then sort the array 函数。