Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can This Tool Generate a Single Angular File with Custom HttpResponse Types and No Additional Files? #1001

Open
jon9090 opened this issue Dec 1, 2024 · 0 comments

Comments

@jon9090
Copy link

jon9090 commented Dec 1, 2024

Before I try this tool (it looks great!), I want to confirm: is it possible to generate a single file, like users.service.ts in Angular, with the following structure?

@Injectable({ providedIn: 'root' })
export class UserApiService {
  #http = inject(HttpClient);

  getUsers() {
    return this.#http.get(`/api/v1/users`);
  }

  user(id: number): Observable<HttpResponse<User>> {
    return this.#http.post<User[]>(`/api/v1/users/search`, { id }, { observe: 'response' });
  }
}

Specifically:

  1. Can I generate the HttpResponse type based on matching specific URLs I provide in a list?
  2. Can the tool avoid generating additional files, keeping everything (like interfaces) in the same file?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant