Skip to content Skip to sidebar Skip to footer

How To Read A Text File And Display It In Html (angularjs)

I am using angularjs and i have a terms of use document in a text file which i was to render into html. Any recommendations on how to read that text file and display it using html

Solution 1:

Simplest way is using ng-include. If you need to use the line breaks in the text file within your view wrap in a <pre> tag

<h3>Terms</h3><ng-includesrc="'terms.txt'"></ng-include>

OR

<preng-includesrc="'terms.txt'"></pre>

DEMO

Post a Comment for "How To Read A Text File And Display It In Html (angularjs)"