Angular 4: How to read content of text file with HTTPClient
Try like this : this.http.get(‘app/files/1.txt’).subscribe(data => { console.log(data.text()); }) The CLI can’t access docments inside the app directory your project. if you move to text document you can access the text file like assets/1.txt. if you want to access document inside the app directory you need to add path in assets array in the .angular-cli.json … Read more