<img src="
" alt="enter image description here">I'm using angularjs with wordpress API and on scope output I have problem to parse the returned CSS.
For HTML parsing I've been using
this one works fine but on CSS I have the following raw output
JSON
For HTML parsing I've been using
Code:
<div ng-repeat ="article in post">
<div ng-bind-html="article.content">
{{ article.content }}
</div>
</div>
angular.module('blancAppApp')
.controller('SlugCtrl', function ($scope, $http, $routeParams) {
$http.get('/wp-json/posts/?type=post&type=page&filter[name]=' + $routeParams.slug ).success(function(res){
$scope.post = res;
return $scope.post;
console.log($scope.post);
});
});
this one works fine but on CSS I have the following raw output
Code:
#gallery-1 { margin: auto; } #gallery-1 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 50%; } #gallery-1 img { border: 2px solid #cfcfcf; } #gallery-1 .gallery-caption { margin-left: 0; }
JSON
Code:
\n<style type='text\/css'>\n#gallery-1 {\nmargin: auto;\n}\n#gallery-1 .gallery-item {\nfloat: left;\nmargin-top: 10px;\ntext-align: center;\nwidth: 50%;\n}\n#gallery-1 img {\nborder: 2px solid #cfcfcf;\n}\n#gallery-1 .gallery-caption {\nmargin-left: 0;\n}\n<\/style>\n