Harrison Tran Harrison Tran - 1 year ago 66
AngularJS Question

AngularJS 1 include preformated html code from templates

I'm writing a tutorial website for angularjs using angularjs and I have a lot sections of sample code.
So I have a bunch of

<pre>&lt;html ng-app&gt;&lt;/html&gt;</pre>

I want to put the code samples in a separate files but
doesn't work on
tags. How would I put html code samples in separate files?

Small side question: what would you name the folder of those files?

I've tried this solution:

But it doesn't seem to work because the sample doesn't stay preformatted for newlines and tabs and I don't know why it doesn't work. Here's my attempt using the previous solution:

Answer Source

Set CSS white-space: pre-wrap; for your myPre directive.