-
Notifications
You must be signed in to change notification settings - Fork 6k
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
index.ts is missing from the TypeScript compilation #7768
Comments
@nize thanks for reporting. does the error also occur in an angular 4 project? |
@macjohnny: No, for angular 4 it works.
app.module.ts:
app.compontent.ts:
|
@nize are you symlinking the generated package or copying / downloading it from a repository? |
I recently ran into this problem using code-gen 2.4.0. I got around the issue by publishing the compiled output.
I was tipped onto this by looking at the documentation in the PetStore sample. It does appear the output of README.md differs based on some configuration. |
I am trying to generate the api and publishing it to an private registry. |
The issue was that ng-packagr requires cli execution The enabling |
Description
When trying to consume a module generated by the Swagger-codegen typescript-angular for version 4.3 in a angular 5 project
ng serve
crashes and says:Swagger-codegen version
2.3.1
Swagger declaration file content or url
http://petstore.swagger.io/v2/swagger.json
Command line used for generation
java -jar .\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l typescript-angular -o C:\angular\petstore-angular4-api
Also tried:
java -jar .\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l typescript-angular -o C:\angular\petstore-angular527-api -c swagger-codegen-config-angular527.json
where the file swagger-codegen-config-angular527.json contained:
{"ngVersion":"5.2.7"}
Steps to reproduce
java -jar .\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l typescript-angular -o C:\angular\petstore-angular4-api
cd C:\angular\petstore-angular4-api
npm login
npm publish
cd C:\angular\petstore-app
npm install petstore-angular4-api
code .
import { ApiModule } from 'petstore-angular4-api';
ApiModule
import { PetService} from 'petstore-angular4-api'
constructor(private petService: PetService) {}
ng serve
Related issues/PRs
None
Suggest a fix/enhancement
Add angular 5 support to Swagger-codegen ?
Add documentation on which parameters are allowed for the parameter
ngVersion
?The text was updated successfully, but these errors were encountered: