Angularとng-repeatを使用して、Ajax jsonからHTMLでテーブルをロードしようとしています。 私の問題は、JSONが少し複雑で、テーブルに表示したい "informationstyp"にアクセスする方法がわかりません。 JSONのルート( "values")はリストです。次のレベル(「informationstyper」)もリストです。角度とngリピートのAjax JSONからテーブルをロード
テーブルに「informationstyp」を取得するにはどうすればよいですか? {{data.arendeslagId}}の代わりに何を書き込むべきですか?私は私のテーブルに何をしたいです
は次のとおりです。
FK1002
FK1003
FK1004
はあなたの助けをいただき、ありがとうございます。私のhtml:
<table class="table table-hover">
<thead>
<tr>
<th>Arendeslagid</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in infotyper">
<td>{{data.arendeslagId}}</td>
</tr>
</tbody>
</table>
私はJavaScript:
$scope.infotyper = "";
$scope.invoke = function() {
$.ajax({
"cache": false,
"async": true,
"crossDomain": true,
"url": url",
"method": "POST",
"headers": {
"cache-control": "no-cache",
},
success: function (response) {
$scope.infotyper= response;
}
});
};
私のJSON応答:
があなたの代わりにjQueryのAJAXの角度で$ HTTPサービスのメソッドを使用することができます要求します。 – hasan
@hasanありがとう、私は今それを$ http – chichi