I'm working on a project with Angular 8. I am building a 'forgot password' page that will call 2 backend endpoints when the user clicks on the submit button.
Here is my code but I don't have any test urls that I can make public: https://stackblitz.com/edit/angular-8-app-example-zxzvt5
To get my http requests to follow through I had to call subscribe on them in this service: ForgotPasswordDataService
Why did I have to do that?
How can I change my code so that I don't need to subscribe and I want to do my routing to the next page in my component instead of my service? e.g.
public onSubmit() {
console.log(' on submit ');
//submit to the server
//route to the next page
this.forgotPasswordDataService.forgotPassword(this.clientcode, this.email).subscribe(() => //TODO: route to the next page);
}