1

I have to read local text file which contains some data I need to extract some specific data from it but when I am using it is reading and displaying whole file in HTML.

CODE:

<div ng-include="'filedta.txt'">

</div> 
2

1 Answer 1

1

What exactly do you mean by local? On the client, or on the server? Anyway, since the code you posted has access to the file, I guess it's on the server, so you can use

$http.get('filedta.txt').then(function(data) {
  //use the file data here
});
Sign up to request clarification or add additional context in comments.

2 Comments

The file is on clinet
If it's in the client folder of your app, the above code will work, if that folder is exposed as a static resource.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.