Skip to content
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

Angular generate-proxy - (Dto missing) #11618

Closed
nev-21 opened this issue Feb 17, 2022 · 4 comments
Closed

Angular generate-proxy - (Dto missing) #11618

nev-21 opened this issue Feb 17, 2022 · 4 comments
Assignees
Labels

Comments

@nev-21
Copy link

nev-21 commented Feb 17, 2022

  • ABP Framework 5.1.3.
  • User Interface Angular 13

Issue Description

The issue occurs if there are two or more abp backend modules, and 1 angular project.
Angular proxy folder contains "models.ts" with missing Dtos.

Steps to reproduce

Create two abp modules(with no ui), both has a reference to a dotnet csproj (not abp) which has few Dtos.

  • Simple dotnet class library project: Dto1, Dto2, Dto3 ( all Dtos in the same namespace "SimpleDtos")
  • Module A has AppService methods that return Dto1 and Dto2.
  • Module B has AppService methods that return Dto3.

Create an Abp App with angular UI, and register the modules in Conventional Controllers (HttpApiHostModule). Run Host.

Run the cli commands in angular folder:

  1. abp generate-proxy -t ng
  2. abp generate-proxy -t ng -m modulea
  3. abp generate-proxy -t ng -m moduleb

Check the proxy folder, inside the simple-dtos folder, the models.ts file:

  • Only the Dto3 is present
@muhammedaltug muhammedaltug self-assigned this Feb 24, 2022
@bnymncoskuner bnymncoskuner removed their assignment Feb 25, 2022
@czart8
Copy link

czart8 commented Mar 8, 2022

I have the same problem. This problem also occured in a 4.x versions.

@enisn enisn self-assigned this Apr 26, 2022
@muhammedaltug
Copy link
Contributor

Hello,

We will work on this. You can follow the steps below to avoid this problem right now:

  • Create an angular package with ng g library module-a
  • Update tsconfig paths for module-a with the following in tsconfig.json
"paths": {
     // other paths
     "module-a": ["projects/module-a/src/public-api.ts"]
   }
  • Update your environment file for module-a with the following in environment.ts
apis: {
    // other apis 
    ModuleA: {
      rootNamespace: 'ModuleA',
    },
  }
  • Run the generate proxy command in angular folder. abp generate-proxy -t ng -m modulea --target module-a -a ModuleA
  • Update public-api.ts in packages/module-a/src/public-api.ts with following code
// other exports
export * from './lib/proxy';
  • Repeat these steps for module-b

You can look example project

@stale
Copy link

stale bot commented Jun 29, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Jun 29, 2022
@stale stale bot closed this as completed Jul 11, 2022
@mrsleepman
Copy link

same problem

abp generate-proxy -t ng

ABP CLI 8.1.3
UPDATE src/app/proxy/generate-proxy.json (355829 bytes)
UPDATE src/app/proxy/README.md (1000 bytes)
UPDATE src/app/proxy/metric.service.ts (2029 bytes)
UPDATE src/app/proxy/metric-type.service.ts (1689 bytes)
UPDATE src/app/proxy/server-info.service.ts (1938 bytes)
UPDATE src/app/proxy/index.ts (112 bytes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants