Configuration
OpenAPI TypeScript Config
Createopenapi-ts.config.ts in your project root:
openapi-ts.config.ts
@hey-api/client-angular- Angular-specific HTTP clientoperations.strategy: 'byTags'- Groups operations by OpenAPI tags into servicesoperations.containerName: '{{name}}Service'- Names services with “Service” suffix
Package Dependencies
package.json
Application Setup
App Configuration
Configure the Angular application with HTTP client and Hey API providers:src/app/app.config.ts
Usage
Component with Dependency Injection
src/app/demo/demo.ts
Template
src/app/demo/demo.html
Key Features
Type Safety
All API calls are fully typed:Dependency Injection
Services are injectable Angular services:Multiple Clients
Support for local and global clients:Running the Example
1
Clone the repository
2
Install dependencies
3
Run the Angular example
4
Open in browser
Navigate to
http://localhost:4200