Angularv19
此内容尚不支持你的语言。
Angular is a web framework that empowers developers to build fast, reliable applications.
The Angular plugin for Hey API generates HTTP requests and resources from your OpenAPI spec, fully compatible with validators, transformers, and all core features.
Collaborators
Section titled “Collaborators”Features
Section titled “Features”- Angular v19 support
- seamless integration with
@hey-api/openapi-tsecosystem - generate HTTP requests
- generate HTTP resources
- minimal learning curve thanks to extending the underlying technology
Installation
Section titled “Installation”In your configuration, add @angular/common to your plugins and you’ll be ready to generate Angular artifacts. 🎉
export default { input: 'hey-api/backend', // sign up at app.heyapi.dev output: 'src/client', plugins: [ // ...other plugins '@angular/common', ],};Output
Section titled “Output”The Angular plugin will generate the following artifacts, depending on the input specification.
Requests
Section titled “Requests”A single function is generated for each endpoint. It returns an HttpRequest result.
export const addPetRequest = (options) => client.requestOptions({ method: 'POST', responseStyle: 'data', url: '/pet', ...options, });export default { input: 'hey-api/backend', // sign up at app.heyapi.dev output: 'src/client', plugins: [ // ...other plugins { name: '@angular/common', httpRequests: true, }, ],};Resources
Section titled “Resources”A single function is generated for each endpoint. It returns a result from httpResource call.
export const addPetResource = (options) => httpResource(() => addPetRequest(options()));export default { input: 'hey-api/backend', // sign up at app.heyapi.dev output: 'src/client', plugins: [ // ...other plugins { name: '@angular/common', httpResources: true, }, ],};You can view the complete list of options in the UserConfig interface.
Examples
You can view live examples on StackBlitz or on GitHub.