OpenAPITools / OpenAPITools/openapi-generator

[REQ] [angular-typescript] Support lazy loaded module

Open
#9,782 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I'd like to use the generated services in a lazy loaded module in angular. So all related code should not be part of the initial bundle.

Describe the solution you'd like

Either this should be possible by default (preferred) or possible to enable via a configuration option.

Describe alternatives you've considered

Importing the GeneratedModule.forRoot(..) in a lazy loaded module currently won't respect the provided Configuration.

Additional context

Probably the services should be provided in the generated module - e.g.:

@Injectable({
  providedIn: MyApiModule,
})
export class MyApiStubService {
}

see https://angular.io/guide/providers#providedin-and-ngmodules

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the angular-typescript generator's generated module and the GeneratedModule.forRoot(..) entry point described in the issue. Investigate how services and Configuration are registered for lazy-loaded modules; done means generated code can be loaded lazily without entering the initial bundle and Configuration is respected.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.