João Colucas
João Colucas

Reputation: 249

AngularJS avoid HTML strip of directive tag

Working with AngularJS, i have a json object with custom HTML, including a directive tag for use with Prism.

For example,

<pre><code  class="language-clike" prism> ... </code></pre>

This results in:

<pre><code class="language-clike"> ... </code></pre>

How can I avoid this?

I'm returning data the following way:

...
$sce.trustAsHtml($scope.page);
...
<article ng-bind-html="page.content"></article>

Upvotes: 1

Views: 112

Answers (1)

BrunoMartinsPro
BrunoMartinsPro

Reputation: 1846

When the DOM is ready use

Prism.highlightAll();

Upvotes: 4

Related Questions