HttpResourcePlugin
The HTTP Resource plugin generates Angular services using the httpResource API for automatic caching, state management, and reactive data loading.
Usage
typescript
// openapi.config.ts
import { GeneratorConfig } from 'ng-openapi';
import { HttpResourcePlugin } from '@ng-openapi/http-resource';
export default {
plugins: [HttpResourcePlugin], // top-level, not inside `options`
... // other configurations
} as GeneratorConfig;Notes
- Scoped interceptors are applied for resources as well
- Currently only supports
GETmethods, as suggested by Angular's documentation ↗️ - Generated resource classes honor
serviceDecorator, so services and resources always use the same decorator - Generated resource class names default to
<Tag>Resourceand can be decorated vianaming.resources; model references follownaming.models