我试图显示集合中的所有用户,如果该用户当前存在于该集合中,因为我需要根据权重匹配用户 . 我尝试了各种各样的事情但无法使其工作 . 我已经尝试显示他们当前所处的权重类别但无法显示或将其记录到控制台中,因此我可以编写,如果语句说明他们是否属于某个类别,则显示该类别中的所有用户及其数据 . see the collections in my database here .ts文件导出类FightersPage {

newrequest = {} as connreq;
      temparr = [];
      feather = [];
      filteredusers = [];
      fighterProfile: AngularFireObject<Profile>

      constructor(public navCtrl: NavController, public navParams: NavParams,
        public userservice: UserProvider, public alertCtrl: AlertController,
        public requestservice: RequestsProvider, private afDatabase: AngularFireDatabase,
        public afAuth: AngularFireAuth, private toast: ToastController) {


        this.userservice.getallusers().then((res: any) => {
          this.filteredusers = res;
          this.temparr = res;

       })
      }


      ionViewwillLoad() {
        this.afAuth.authState.take(1).subscribe(data=>{
          if (data && data.email && data.uid) {
            this.toast.create({
              message: `welcome, ${data.email}`,
              duration: 3000
            }).present();

            this.fighterProfile = this.afDatabase.object(`Featherweight/${data.uid}`)
          }
          else {
            this.toast.create({
              message: `could not find your details`,
              duration: 3000
            }).present();
          }
        })

在html文件中,我已经尝试过这种方式:

*ngFor="let profile of featherweight$ | async"

当尝试这种方式我尝试从这样的火基地获取ref但我相信我需要使用switchmap运算符?不完全确定这是什么,所以任何帮助将不胜感激 .

var uid = firebase.auth().currentUser.uid;
  var ref= firebase.database().ref("featherweight/"+ uid);

这样:

Weight: {{(fighterProfile| async)?.weight}}

我对离子相对较新,所以任何帮助都会受到赞赏 .