Reading data.json with HttpClient on Stackblitz?
问题 I have a tiny demo and it attempts to read app/data.json using the Angular HttpClient. const post$:Observable<Post> = <Observable<Post>> http.get('./data.json'); However the HttpClient reponse says: Failure during parsing ... Thoughts? 回答1: Stackblitz currently doesn't serve static files except the case when they are in assets folder. So you have two options here: 1) Import json directly as module import data from './data.json'; console.log(data) // => {title: "Simulating HTTP Requsts",