Having trouble displaying my data in HTML using ng-repeat. I am attempting to dynamically create rows, but the list is not showing up.
This is how my controller looks like:
app.controller('SearchBusController',['$scope','$sessionStorage','$http','$state',function($scope,$sessionStorage,$http,$state){
var a="http://localhost:8080/business/allbusiness";
$scope.BusinessList=[];
$.ajax({
type:'GET',
url:a,
success:function(data){
$scope.BusinessList=data;
console.log(data)
},
error:function(data){
//alert("unsuccessfull");
},
dataType:"json",
contentType:"application/json",
});
}]);
This is the HTML code being used:
<div ng-app="app" ng-controller="SearchBusController">
<table class="table1" cellspacing="0px" border="1" width="60%;" style="background:white;">
<tr ng-repeat="business in BusinessList">
<td width="13%">
<img src="images/welcome.jpg" style= "width:100%;" align="left">
</td>
<td colspan="2">
<a href="">
<p><span><h3 style="color:white;">{{business.BusinessDTO.company_name}}</h3></p></span></a>
<a href="">
<p><span><h3>{{business.BusinessDTO.address}}</h3></p></span></a>
</td>
</tr>
<table>
</div>
The list in $scope.BusinessList contains:
{"businessList":[{"BusinessDTO":{"businessId":1,"company_name":"Zafin","about_company":"asdasd"}},{"BusinessDTO":{"businessId":2,"company_name":"aaa","about_company":"hgfh"}}]}
Can anyone offer some guidance on this issue?