While I grasp the process Angular uses for HTTP requests, I find myself leaning towards utilizing the Fetch API instead. It eliminates the need to subscribe and unsubscribe just for a single request, making it more straightforward. When I integrated it into my Angular app, there were no errors, the page didn't refresh (which is important for a Single Page Application), and everything functioned smoothly. It seems that each method has its own time and place.
Consider this example:
fetch('/api/get_post_by_id/1').then(response => response.json()).then(data => { console.log(data); });
This approach seems simpler compared to:
const observable = this.http.get('/api');
observable.subscribe(() => { ... });
observable.unsubscribe();
So, my question remains: Is it inappropriate to utilize the Fetch API while working on Angular projects?