Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 单击进入ng select后,角度不工作单击表格_Javascript_Angular_Html Table_Angular Ngselect - Fatal编程技术网

Javascript 单击进入ng select后,角度不工作单击表格

Javascript 单击进入ng select后,角度不工作单击表格,javascript,angular,html-table,angular-ngselect,Javascript,Angular,Html Table,Angular Ngselect,我从后端获取数据,我需要在表中显示它。 数据必须按某些属性分组,以下是代码: getRows(data: MyData[]): Array<Array<MyData>> { const exceptionsArray: Array<Array<MyData>> = []; const exceptions = new Map<string, Array<MyData>>(); data.f

我从后端获取数据,我需要在表中显示它。 数据必须按某些属性分组,以下是代码:

    getRows(data: MyData[]): Array<Array<MyData>> {

    const exceptionsArray: Array<Array<MyData>> = [];

    const exceptions = new Map<string, Array<MyData>>();
    data.forEach(exc => {
        const key = exc.name != null ? exc.name + '_' + exc.id : exc.id;
        const exceptionsArray = exceptions.has(key) ? exceptions.get(key) : new Array<MyData>();
        exceptionsArray.push(exc);
        exceptions.set(key, exceptionsArray);
      }
    );

    exceptions.forEach((value: Array<MyData>) => {
      exceptionsSet.push(value);
    });
    return exceptionsSet;
  }
getRows(data:MyData[]):数组和我在这个ng中单击选择并返回到带有表的页面上,链接是不可单击的。鼠标已更改,但模式窗口未打开。我试着在点击时打印到控制台,但也不起作用

当我按F5(刷新页面)时,一切都开始工作。我用的是角5

多谢各位

已编辑

增加


当我在angular版本10中复制这段代码时,所有代码都运行良好

一个运行良好的stackblitz示例将很容易理解debug@MrKhan附加闪电战
<table width="100%">
<thead>..

<ng-container *ngFor="let row of getData(mpnIpn.data)">
      <tr *ngFor="let record of row">
        <td class="small text-muted noBg">&nbsp;</td>
        <ng-container *ngIf="allowManipulate; else emptyCells">
          <td class="noBg">
            <a class="pointer text-nowrap" title="New comment"
               (click)="newComment(record)">New comment</a>
            <span *ngIf="row.length > 1">
              /&nbsp;<a class="pointer text-nowrap" title="Modify records"
                        (click)="modifyRecords(record)">Modify records</a>

            </span>
          </td>
        </ng-container>
        <ng-container #emptyCells>
          <td class="noBg">&nbsp;</td>
        </ng-container>
      </tr>
    </ng-container>
</thead>