I have successfully return JSON data using PHP and delivered to my user's browser successfully. The return JSON is like this.
{
"html":"<div class='sampleClass'><span>Test Site</span></div>"
}
Here is my angular js code
var app = angular.module('myApp', []);
app.controller('testCtrl', function($scope, $http, $log) {
var successCallBack = function(response){
$scope.test=response.data.records;
}
var errorCallBack = function(response){
$scope.error = response.data;
}
$scope.getAll = function(){
$http.get("read_list.php").then(successCallBack,errorCallBack);
}
});
And here is how I display the data
<tbody ng-init="getAll()">
<tr ng-repeat="d in test">
<td>{{ d.html }}</td>
</tr>
</tbody>
What I want to achieve is to ouptut the above JSON like this
Test Site
just the Test Site only, not the whole html return.
I do some research about here but still I have no luck. I hope someone will help me with this.
BTW, I'm using angular js here to display the data.
Thanks.