angular-service-proxy-patterns

Generates and consumes NSwag service proxies in ASP.NET Zero Angular applications.

Updated May 22, 2026
One-click install
npx skills add https://github.com/shakesoft/timekeeper --skill angular-service-proxy-patterns-shakesoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: angular-service-proxy-patterns
Source: https://github.com/shakesoft/timekeeper/tree/main/.cursor/skills/angular-service-proxy-patterns
Command: npx skills add https://github.com/shakesoft/timekeeper --skill angular-service-proxy-patterns-shakesoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Angular developers working with ASP.NET Zero often manually create service proxy classes or forget to register new NSwag-generated proxies as providers, causing runtime errors like NG0201. This Skill enforces the correct workflow for generating, registering, and consuming auto-generated service proxies. ## Core Features & Use Cases - NSwag Proxy Generation: Guides running npm run nswag against a live Web.Host backend to regenerate service-proxies.ts from Swagger/OpenAPI. - Provider Registration: Ensures every new *ServiceProxy class is added to SERVICE_PROXY_PROVIDERS in service-proxy.providers.ts to avoid Angular DI errors. - Usage Patterns: Provides canonical patterns for list, create/update, and delete calls using DTO constructors, inject() for DI, and finalize() for loading-state cleanup. - Use Case: After adding a new ProductAppService on the backend, regenerate proxies, register ProductServiceProxy as a provider, and call getProducts with a single GetProductsInput DTO bound to PrimeNG table pagination. ## Quick Start Regenerate the NSwag service proxies and wire up the new ProductServiceProxy in my Angular component following the standard patterns.

Frequently Asked Questions about angular-service-proxy-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I regenerate NSwag service proxies in ASP.NET Zero Angular?▼

Run the Web.Host backend project first, then execute `npm run nswag` in the angular/ directory (or angular/nswag/refresh.bat on Windows). Output is written to angular/src/shared/service-proxies/service-proxies.ts.

Why does Angular throw NG0201 No provider found for ServiceProxy?▼

This error occurs when a newly generated ServiceProxy class is not registered in service-proxy.providers.ts. After every NSwag regeneration, add each new proxy class to the SERVICE_PROXY_PROVIDERS array.

Should I manually create ServiceProxy or DTO classes in Angular?▼

No. All service proxies and DTOs are auto-generated by NSwag from the backend Swagger/OpenAPI specification. Manually created classes will be overwritten and cause inconsistencies.

How do I call a list method with pagination in ASP.NET Zero Angular?▼

Pass a single input DTO constructed with an object literal, e.g. new GetProductsInput({ filter, sorting, maxResultCount, skipCount }). Use primengTableHelper.getMaxResultCount(paginator, event) and getSkipCount(paginator, event) for pagination values.

How do I handle loading states when calling service proxies?▼

Use the RxJS finalize operator in the pipe to hide loading indicators or reset saving flags regardless of success or error, e.g. .pipe(finalize(() => this.primengTableHelper.hideLoadingIndicator())).