-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Open
Labels
area: formsgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
forms
Description
when using the angulat httpclient to submit a form we have to do something very ugly like
action: async (form) => {
try {
await firstValueFrom(this.authService.registerUser(form().value()));
this.router.navigate(['/login']);
return undefined;
} catch (_) {
return {
kind: 'server',
message: 'Something went wrong. Please try again.',
} satisfies ValidationError.WithOptionalFieldTree;
}
},Proposed solution
When using a generated httpclient for e.g. the one from openapi generator or when using angulars httpclient in general to submit the form to a backend it would be only convenient and in the tradition of angular to return an observable from the action.
Alternatives considered
using firstValueFrom does work, but doen't feel like angular native
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: formsgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini