Ramana Uday
Ramana Uday

Reputation: 355

Calling google-prettify in Angularjs

I am trying to apply Google Prettify to my AngularJS code but it is working after the ng-route. I also have added a directive for prettify but still facing the problem:

app.directive('prettyprint', function() {
return {
    restrict: 'C',
    link: function postLink(scope, element, attrs) {
          element.html(prettyPrintOne(replaceText(element.html()),'',true));
    }
  };
});

Here is the Plunker regarding this:

http://plnkr.co/edit/3400Grdp5HejzKuK1sCq?p=preview

Upvotes: 0

Views: 82

Answers (0)

Related Questions