2
私はapiサーバからデータを取り出してTypeScriptのオブジェクトとして保存していますが、そのデータをキーと値のペアとしてHTMLで参照する手助けが必要です。HTMLのオブジェクトをAngular2で参照する
活字体:
if (x.AttributeTemplateId==templateId) {
x['AttributeTemplateValue'].forEach(function(x){
console.log('hello');
if (x.AttributeTemplateId==templateId){
console.log(templateId);
(function(y){
console.log("hello2");
newName.push(y.CodeSet);
newValue.push(y.CodeValue);
// console.log([newAttributes]);
})(x);
}
})
}
})
newName = this.name;
newValue = this.value;
this.attributes = this.name.reduce((acc, value, i) => (acc[value] = this.value[i], acc), {});
console.log(this.attributes);
}
私のデータがthis.attributes
であり、それはこの
のように見えます
<table>
<tr>
<th> Name </th>
<th> Value </th>
</tr>
<tr key>
<td value > </td>
</tr>-->
</table>
Angular2でどのようにこれを達成できますか?