Angular 4:Table ng-if 值等于行 header

Angular 4: Table ng-if value equals row header

我需要一些帮助...我想创建一个如下图所示的 Table。当列名与行 "header/name" 匹配时,它应该显示一些值,如“1”或 "x"。

<table class="thead-dark">
    <tr>
      <th class="pointer">
        Name
      </th>

      <th class="pointer" *ngFor='let item of applicationlist'>{{item.AName}}
      </th>
    </tr>
    <tr *ngFor='let item2 of liste'>
      <th class="pointer">{{item2.AName}}</th>
      <td *ngFor='let item of applicationlist'>{{item2.HApllication}}</td>
    </tr>
</table>

我的 .ts 文件的一部分

bestfuncever() {
    const rootRef = firebase.database().ref();
    const maintable = rootRef.child('/BFunctions/').orderByChild('CFlag').equalTo('active');
    maintable.on('child_added', snap => {


      if (snap.val()) {
        this.liste.push(snap.val());
      }
      console.log(this.liste)
      let BFuncGBProcess = rootRef.child('BFunctions/' + snap.key + '/HApllication');
      BFuncGBProcess.once('value').then(Processes => { 
        if (Processes.val()) {
          this.Processlist.push(Processes.val())};
        let BProess = rootRef.child('Application/' + Processes.val());
        BProess.once('value').then(Applications => {
          if (Applications.val()) {
            this.applicationlist.push(Applications.val());
              console.log(this.applicationlist)
          }
        })
      })
    })
  }

好的,我自己搞定了! <ng-container *ngFor='let item of applicationlist'> <td *ngIf="item.AName==item2.HApllication; else wrong">1</td> <ng-template #wrong><td>0</td></ng-template> </ng-container>