javascript - how to read a text file and display it in html (angularjs) -


i using angularjs , have terms of use document in text file render html. recommendations on how read text file , display using html or display user? thanks

simplest way using ng-include. if need use line breaks in text file within view wrap in <pre> tag

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

or

<pre ng-include src="'terms.txt'"></pre> 

demo


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -