Closed
Description
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
$ ng --version
@angular/cli: 1.0.1
node: 6.9.1
os: win32 x64
@angular/common: 4.1.0
@angular/compiler: 4.1.0
@angular/core: 4.1.0
@angular/forms: 4.1.0
@angular/http: 4.1.0
@angular/platform-browser: 4.1.0
@angular/platform-browser-dynamic: 4.1.0
@angular/router: 4.1.0
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.0
Repro steps.
- Add a .txt or .json file anywhere in the project
- Add another in /src/assets/
- Run
ng serve
from the command line in the Angular application - Open up the dev console and look for the files in the Sources tab OR set up a service to make a HTTP request to the file path you expect the static file to be at
- A 404 will occur
The log given by the failure.
N/A
Desired functionality.
Would like to be able to access static files within the Angular application.
Mention any other details that might be useful.
When building out an Angular v2 application (when Angular CLI was still in beta release) I was able to serve static text files inside of my /app directory and get them with Http.get('app/example-dir/test-file.json') from @angular/http
Metadata
Metadata
Assignees
Labels
No labels