-
Notifications
You must be signed in to change notification settings - Fork 423
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
Templatized ModuleWithProviders in typescript-angular #730
Templatized ModuleWithProviders in typescript-angular #730
Conversation
The call ModuleWithProviders requires a template: https://angular.io/api/core/ModuleWithProviders Apparently, in Angular 10, this is strictly enforced
@@ -18,7 +18,7 @@ import { {{classname}} } from './{{importPath}}'; | |||
{{/hasMore}}{{/apis}}{{/apiInfo}} ] | |||
}) | |||
export class ApiModule { | |||
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { | |||
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for consistency with V2 and to allow backwards compatibility with versions of Angular <10 this should be:
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders{{#genericModuleWithProviders}}<ApiModule>{{/genericModuleWithProviders}} {
To enable the change during code generation you would need to add a property to the Maven build:
<configuration>
<language>typescript-angular</language>
<additionalProperties>
<additionalProperty>ngVersion=10.2.0</additionalProperty>
<additionalProperty>genericModuleWithProviders=true</additionalProperty>
</additionalProperties>
</configuration>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback!
I actually copied the method from swagger-api/swagger-codegen#10464 which automatically sets genericModuleWithProviders if angular is >= 7.
@HugoMario any chance this PR could be merged in? |
Why is this not merged? With Angular 12 it is not possible to use |
Can we get this merged? |
It would be good to see this change merged in. The swagger generator for Angular is really falling behind the current version of Angular. |
Why is this PR still not merged? |
Who is responsible for typescript-angular and is this person still active? What would I have to do, in order to overwrite the respective template manually? I tried it with option -t but to no avail. |
Thanks for PR, and sorry for this big delay :/ |
The call ModuleWithProviders requires a template: https://angular.io/api/core/ModuleWithProviders
Apparently, in Angular 10, this is strictly enforced