Skip to content

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

@jon9090

Description

@jon9090

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions