## HTML文件:##
<html ng-app = "TM">
<h1> Requested Businesses </h1>
<form class="form">
<body ng-controller = "appController">
<table class="col-xs-12">
<tr>
<th>Email</th>
<th>BusinessName</th>
<th></th>
</tr>
<h1 ng-repeat= "item in protocolList">
<tr>
<td>{{item.requesterMail}}</td>
<td>{{item.business_name}}</td>
我的html视图中没有显示任何内容:(
##角度控制器:##
angular.module('TM', ['AppRoutes']).controller('appController', function($scope, $http,$location){
$http({
method: 'GET',
url: '../businessreq',
}).then(function(data) {
$scope.protocolList= data.data;
console.log($scope.protocolList);
});
});
控制台正确打印protocolList
答案 0 :(得分:4)
td
元素之间不能有h1。将ng-repeat
放入tr
,删除你的h1,它应该有效。