[Angular 4+] [Typescript Client] OpaqueToken deprecated in Angular 4
Description
OpaqueToken is deprecated in Angular 4 and will be removed in 2 versions according to the Angular deprecation policy. InjectionToken
Swagger-codegen version
2.2.2
Steps to reproduce
Use PetStore example to generate Angular2TypescriptClient
Related issues
https://github.com/angular/angular/issues/14763
Suggest a Fix
Simply changing the type from OpaqueToken to InjectionToken<string> will work, however, this is will break Angular 2 clients, so I am unsure of how to approach this. Should it be a command line flag on the Angular client build or should it be a separate client?
@iblocks-Xander CC @wing328
How about providing command line option like useOpaqueToken? If this option is provided as true, generator will use OpaqueToken as it does now. If this option is not provided or provided as false, it will use InjectionToken<string>.
@iblocks-Xander please pull the latest master to give it a try.
Thanks for the PR from @taxpon
@wing328 Works for me. Although I wonder whether the default should be OpaqueToken rather than InjectionToken, just so updating does break existing workflows.
Thanks for the PR @taxpon
@iblocks-Xander what about setting the default to "OpaqueToken" in current master and "InJectionToken" in 2.3.0 (a branch with breaking changes)?