Error: Uncleanness (in promise): Response with status: 404 Not found for url when upgrading to Angular-CLI + Angular 4
I updated my project, and everything was fine Angular 2 and now 4. Now I have resulted Angular-CLI 1.0.0
and it will not find the json file for primeNG.
constructor(private http: Http) {}
getFiles() {
return this.http.get('mock_data/data.json')
.toPromise()
.then(res => <TreeNode[]> res.json().data)
.then(data => { return data; });
}
Throws an error and I tried adding ./
to copy the folder path to double check.
In my index.html
file I have <base href="/">
and the directory is undersrc
Mistake:
core.es5.js:1084 ERROR Error: Uncaught (in promise): Response with status: 404 Not Found for URL: http://localhost:4200/mock_data/data.json
+3
source to share