我觉得我错过了什么.当我尝试data attribute在我的中使用时template,像这样:
<ol class="viewer-nav">
<li *ngFor="#section of sections" data-value="{{ section.value }}">
{{ section.text }}
</li>
</ol>
Run Code Online (Sandbox Code Playgroud)
Angular 2 崩溃:
EXCEPTION:模板解析错误:无法绑定到"sectionvalue",因为它不是已知的本机属性("
] data-sectionvalue ="{{section.value}}"> {{section.text}}
我显然遗漏了一些语法,请帮忙.
假设我有很大的单元格网格,我想添加数据行和数据col属性值并从模型绑定.如何从angular2(Dart中的beta0)绑定数据行.
使用data-row ="{{boundVal}}绑定"似乎不起作用.(输出html中没有数据属性)
例如.
<table>
<tr *ngFor="#row of rows" >
<td *ngFor="#cell of row.cells" data-row="{{row.index}}" data-col="{{cell.index}}" >
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)