我无法将行添加到HTML中的表格,该表格来自包含对象的数组。将数据从GET请求添加到HTML表格中使用ng-repeat
当我运行我的代码做了$get请求,就像这样:
var app = angular.module('TM', []);
app.controller('tableController', function($http){
this.protocolList = [];
// Initialise array
$http.get('../protocols').success(function(data) {
console.log('Success ' + data);
this.protocolList = data;
angular.forEach(this.protocolList, function(value, key) {
console.log(key + ': ' + value.id + ' - ' + value.name);
});
})
.error(function(){
console.log('Error ' + data)
});
});
当我打开网页浏览器,我看到以下内容:
我的问题occure时我尝试将其添加到我的HTML文件中的表中:
{{ c }}
{{ value }}任何帮助将不胜感激。
2015-07-10
Nilzone-
+1
你的tableController是如何在你的HTML文件中引用的? –