Reputation: 23
I am trying to connect my ionic / angular app to a spring boot back end. I check the back end with postman and am able to get a result from the get request. When I do it with my app I get "A network error occurred". I am just learning angular - but I do another get request to firebase - and that request works fine. After doing some research ppl suggested it might be related to CORS - I have Cross Origins enabled on the spring boot app - also downloaded the extension to turn off just to make sure.
Any help would be great! Code below.
(from service)
getTimesheets() {
console.log('Service: getTimesheets()')
console.log('URL: ' + this.url)
return this.http
.get(this.url)
.subscribe(data => {
console.log(data)
});
}
(from timesheet.ts)
getTimeSheets() {
this.timeSheetService.getTimesheets()
}
Upvotes: 0
Views: 504