I am trying to integrate Angular 2 application with Java Spring Boot backend. For the moment, I place my Angular 2 files under src/main/resources/static (meanin
The reason of this error was that I used Angular Tour of Heroes applcation as a basis for mine, and I did not remove the dependency
"angular-in-memory-web-api": "~0.2.4",
and InMemoryWebApiModule from app.module.ts. Because of this all requests were intercepted by InMemoryWebApiModule (despite I did not call it directly as described in Tour of Heroes Tutorial), that's why I did not see any XMLHttpRequests in 'Network' tab of the browser debugger.
After I have removed the dependency from package.json and node_modules directory, it started working normally, however, I had to change the service code to parse Json directly to TypeScript objects like this:
getLanguages(): Promise {
return this.http.get(this.langUrl)
.toPromise()
.then(response => response.json() as Language[])
.catch(this.handleError);
}
This is a newbie mistake, but I hope this post will save a couple of hours of research to someone.