【发布时间】:2016-10-10 18:04:00
【问题描述】:
正在使用的版本:
- Angular 2.0.1
- angular-cli 1.0.0-beta.17
我有一个分为 3 个组件的页面。页面大纲,一个有自己布局的表格,包括行,其中一行包含一个行组件。 在 IE 中表格显示正常,在 Chrome 中,组件行中的所有数据都显示在第一列中。
main.html
<form>
<div>Title Stuff etc.</div>
<table-component [qlineModel]="QuoteLineModel"></table-component>
<div>Other stuff</div>
</form>
table.html
<table>
<thead>
<tr>
<th>ColA</th>
<th>ColB</th>
<th>Option</th>
</tr>
</thead>
<tbody>
<row-component *ngFor="let qlines of qlineModel"
[qline]="qlines">
</row-component>
<tr>
<td>Tot A</td>
<td>Tot B</td>
<td>Tot Opt</td>
</tr>
</tbody>
</table>
row.html
<tr>
<td>{{qline.A}}</td>
<td>{{qline.B}}</td>
<td>{{qline.C}}</td>
</tr>
IE 给出了我期望的输出
Title Stuff etc
ColA | ColB | Col C
100 200 300
200 300 400
___________________
300 500 700
Other Stuff
但是,Chrome 给了我一个我没想到的输出
Title Stuff etc
ColA | ColB | Col C
100 200 300
200 300 400
_____ ______________
300 500 700
Other Stuff
我可以通过将表格数据放入一个组件中来解决它,但是 a) 对我来说破坏了对象 b) 我想可能将表格打印出来,所以理想情况下希望保持原样。 我试过Angular2 table rows as component,但一直得到 NgFor 只支持数组之类的 Iterables
感谢您的帮助。
【问题讨论】:
标签: google-chrome internet-explorer angular angular2-components