AngularJS parsing CSS code

admin

Administrator
Staff member
<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

Code:
&lt;div ng-repeat ="article in post"&gt;
    &lt;div ng-bind-html="article.content"&gt;
        {{ article.content }}
    &lt;/div&gt;
&lt;/div&gt;

angular.module('blancAppApp')
  .controller('SlugCtrl', function ($scope, $http, $routeParams) {

    $http.get('/wp-json/posts/?type=post&amp;type=page&amp;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&lt;style type='text\/css'&gt;\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&lt;\/style&gt;\n