Angular: preserve requirements through advanced agent edits
Work through TypeScript examples of real application boundaries: Cancel obsolete Angular HttpClient searches with switchMap; Keep Angular form extras out of the profile mutation payload. Each recipe includes implementation code, integration prerequisites, failure-path tests to add, a Perch rule, and the captured broken/fixed source checks.
Download the Angular rule pack ZIP · Inspect the YAML rules
TypeScript
A search stream can issue a new request before the previous response arrives. switchMap keeps the latest request as the active subscription; mergeMap permits older responses to continue into the results stream. Debouncing reduces traffic but does not replace cancellation.
Broken edit flagged · corrected edit passes
TypeScript
A form object can accumulate hidden control values and metadata during refactors. Explicit projection keeps privileged or stale fields from entering this API contract. TypeScript types do not remove unexpected runtime properties.
Broken edit flagged · corrected edit passes
Use a correction as a saved requirement
Choose the failure you need to prevent, add the scoped rule to your repository, and check both the broken and corrected implementation. Ask your agent to inspect the finding, repair the code and recheck the same rule. Keep framework tests beside the model check.
Perch keeps the requirement beside the code. Reuse the named check during the agent’s next edit and in CI, with cached answers free on unchanged requests.
Official Angular documentation · All language and framework recipes