来自另一个组件表的Mat-cell定义

时间:2019-09-25 11:38:42

标签: angular6

我是Angular 6的初学者。我在一个组件中有一个名为'FLoorSpaceOFC'的mat-table单元,该单元根据dataSource中的数据(字符串)计算设备的租金。字符串值为“室内”,“室外”和“未安装”。根据这些值,租金发生变化。例如,如果是“室内”,则租金为100;如果是“室外”,则租金为50;如果未安装,则租金为0等。

我尝试了* ngIf和{{element.value}}选项,但不起作用

<table mat-table [dataSource]="VILKerala" class="mat-elevation-z8">

<ng-container matColumnDef="FloorSpaceOFC">
    <th mat-header-cell *matHeaderCellDef>OFC Floor space 100INR/rack</th>
    <td mat-cell *matCellDef="let element"></td>          
  </ng-container>

<tr mat-header-row *matHeaderRowDef="displayedColumns  " ></tr>
        <tr mat-row *matRowDef="let myRowData columns: displayedColumns" ></tr>   



import { Component, OnInit } from '@angular/core';
import { ExcelService } from '../excel.service';
import { VILKerala } from '../assetmodel';
import { ApiService } from '../api.service';
import { MatTableDataSource } from '@angular/material';

displayedColumns =['RFID','InfraID','InfraOwner','SiteName','Zone','District','Tenancy','FloorSpaceOFC','OfcFloorAreaID','OfcFloorAreaOD',
                    'BbuFLoorAreaID','BbuFLoorAreaOD','Ip55ODFloorArea','McuODFloorArea','TcuODFloorArea','TotalIDFLoorArea',
                    'TotalODFloorArea','RackSapce','UspaceCharge','Floor&RackSpaceCharge','LoadingCharges','ExpectedDCEM','BilledDCEM',
                    'DCEM difference','EBCost','DiseslCost','TotalEnergyCharges'
]

0 个答案:

没有答案