Hi,
I am new AngularJS. Need to get html content through ajax call in agulurJS.
When trying to display the result in table, it also displaying the tag with
class name..
Here is my example,
<table>
<tr>
<th>Name</th>
<th>City</th>
<th>Country</th>
</tr>
<tr ng-repeat="x in names">
<td>{{x.Name}}</td>
<td>{{x.City | uppercase}}</td>
<td>{{x.Country}}</td>
</tr>
</table>
<script type="text/javascript">
var app = angular.module('myApp',[]);
app.controller('myController',function($scope,$http){
$http.get("response.php").success(function(response) {
$scope.names = response;
});
});
</script>
Response.php:
<?php
$arr = array(array('Name'=>'<span
class="sample">test</span>','City'=>'test','Country'=>'test'));
echo json_encode($arr);
?>
Thanks.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.