Browse Source

update: documents for the resource api option

pull/25761/head
sumeyye 3 weeks ago
parent
commit
70c4296f7e
  1. 18
      docs/en/cli/index.md
  2. 5
      docs/en/framework/ui/angular/service-proxies.md

18
docs/en/cli/index.md

@ -809,14 +809,15 @@ abp generate-proxy -t csharp -url https://localhost:44302/
- `csharp`: C#, work in the `*.HttpApi.Client` project directory. There are some additional options for this client:
- `--without-contracts`: Avoid generating the application service interface, class, enum and dto types.
- `--folder`: Folder name to place generated CSharp code in. Default value: `ClientProxies`.
- `ng`: Angular. There are some additional options for this client:
- `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
- `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
- `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
- `--module`: Backend module name. Default value: `app`.
- `--entry-point`: Targets the Angular project to place the generated code.
- `--url`: Specifies api definition url. Default value is API Name's url in environment file.
- `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
- `ng`: Angular. There are some additional options for this client:
- `--api-name` or `-a`: The name of the API endpoint defined in the `/src/environments/environment.ts`. Default value: `default`.
- `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
- `--target`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
- `--module`: Backend module name. Default value: `app`.
- `--entry-point`: Targets the Angular project to place the generated code.
- `--url`: Specifies api definition url. Default value is API Name's url in environment file.
- `--resource-api`: Adds optional Resource API helpers for `GET` endpoints while keeping the generated Observable services. This parameter requires Angular v22 or later.
- `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
- `js`: JavaScript. work in the `*.Web` project directory. There are some additional options for this client:
- `--output` or `-o`: JavaScript file path or folder to place generated code in.
- `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`.
@ -1314,4 +1315,3 @@ var tokenResponse = await httpClient.RequestClientCredentialsTokenAsync(
- [Examples for the new command](./new-command-samples.md)
- [Video tutorial](https://abp.io/video-courses/essentials/abp-cli)

5
docs/en/framework/ui/angular/service-proxies.md

@ -88,12 +88,15 @@ export const environment: Config.Environment = {
- **target:** Target for the Angular project to place the generated code. For example, if it's `permission-management`, it'll look like this (npm/ng-packs/packages/*permission-management*).
- **entryPoint:** To create the generated proxy folder in the target. The directory is `permission-management/proxy/src/lib/proxy` and the `permission-management` is the value of target. If you want to create a folder for the generated proxy, there are two options, you should either set the value `proxy` as the entryPoint or go to project.json and change the `sourceRoot` from `packages/permission-management/src` to `packages/permission-management/proxy/src`. No need to change the sourceRoot of project with the property. if you keep it empty, the proxy will be generated into the folder defined in the sourceRoot property.
- **serviceType:** The service type of the generated proxy. The options are `application`, `integration` and `all`. The default value is `application`. A developer can mark a service "integration service". If you want to skip proxy generation for the service, then this is the correct setting. More info about [Integration Services](../../api-development/integration-services.md)
- **resourceApi:** Generates optional `rxResource` helpers for `GET` endpoints. This is off by default and keeps the current Observable-based services unchanged. This parameter requires Angular v22 or later
### Services
The `generate-proxy` command generates one service per back-end controller and a method (property with a function value actually) for each action in the controller. These methods call backend APIs via [RestService](./http-requests#restservice).
If you pass `--resource-api`, the generator keeps those methods and adds matching `rxResource` helpers for read operations.
A variable named `apiName` (available as of v2.4) is defined in each service. `apiName` matches the module's `RemoteServiceName`. This variable passes to the `RestService` as a parameter at each request. If there is no microservice API defined in the environment, `RestService` uses the default. See [getting a specific API endpoint from application config](./http-requests#how-to-get-a-specific-api-endpoint-from-application-config)
The `providedIn` property of the services is defined as `'root'`. Therefore there is no need to provide them in a module. You can use them directly by injecting as shown below:
@ -188,4 +191,4 @@ When you run a project on Visual Studio using IIS Express as the web server, the
## See Also
* [Video tutorial](https://abp.io/video-courses/essentials/generating-client-proxies)
* [Video tutorial](https://abp.io/video-courses/essentials/generating-client-proxies)

Loading…
Cancel
Save