Bodzio
Bodzio

Reputation: 2520

How to display code block in AngularJS app

I'm trying to create some website about AngularJS in AngularJS ;-) I've added ng-app on body element, and now all my code snippets (which are all in <pre><code> ... </code></pre> tags) are parsed by angular (it adds ng-binding class for example). Is there a way to tell angular that given block is only code snippet and should't be parsed?

Upvotes: 3

Views: 3055

Answers (1)

Ben Diamant
Ben Diamant

Reputation: 6206

Yes, you can use the ngNonBindable directive

For example:

<div ng-non-bindable>Ignored: {{1 + 2}}</div>

Upvotes: 9

Related Questions