I’m pulling in data from an external site using this code –
<script>
var app = angular.module('myApp', ["ngSanitize"]);
app.controller('aLlCtrl', function($scope, $http) {
var url = 'https://www.hcrlaw.com/wp-json/posts?filter[category]=news_post&filter[posts_per_page]=30';
$http.get(url).then(function(data) {
$scope.data = data.data;
});
});
</script>
<div id="changingArea">
<body ng-app="myApp">
<!--SHOOTING TYPE-->
<div id="All" class="descshoot">
<div ng-controller="aLlCtrl">
<div ng-repeat="d in data">
<h2 class="entry-title title-post"><a href="{{d.link}}">{{d.title}}</a></h2>
<p>{{d.excerpt}}</p>
</div>
</div>
</div>
I’s pulling in fine, but how can I get rid of tags such as <p>
appearing? For example –
I’ve seen ways in which people use ng-sanitise but from what i understand you have to specify each piece of text you want to target and this would be really inconvenient as it’s pulling in lots of posts from WordPress,
Any help would be much appreciated, thanks!