d2-04-form-page
Installation
SKILL.md
Day 2 · Step 4 — Form page, then redeploy
up-app/src/app/pages/<entity>-form/<entity>-form.component.ts:
- Reads
idfrom the route (ActivatedRoute). Noid→ create mode (empty form).idpresent → edit mode (callgetById(id)to prefill). - Cancel button →
router.navigate(['/<entity>'])without saving. - Save button → create mode calls
save(), edit mode callsupdate(id, ...); on success (the subscribe'snextcallback),router.navigate(['/<entity>']).
Redeploy from the project root:
docker compose up -d --build
Verify: Add → fill form → Save → back on search with the new row. Edit that row → change a field → Save → row updated.