d2-04-search-delete-page
Installation
SKILL.md
Day 2 · Step 4 — Search page with capability-based features
Note: This skill adapts based on capabilities selected in d2-03-main-menu:
- If
searchis selected: shows list with Edit button - If
deleteis also selected: adds Delete button with inline confirmation popup - If only
search: no Delete button
up-app/src/app/pages/<entity>-search/<entity>-search.component.ts (standalone component):
- Use
signal<Entity[]>([])to store the items list; on data fetch, call.set()to update. - On init, call
<entity>Service.getAll()andthis.items.set(data)to update signal. - If
createcapability enabled: Header bar with an Add button →router.navigate(['/<entity>/new']). - Add Back button that navigates to home/menu →
router.navigate(['/']). - Per row (use
@forwithtrack item.id):- Edit button →
router.navigate(['/<entity>', item.id, 'edit'])(always included) - Delete button (only if
deletecapability selected) → show confirmation popup; if confirmed, call<entity>Service.delete(id)and update signal with.set()on success.
- Edit button →
Routes: Already defined in d2-03-main-menu (complete app.routes.ts). This skill uses those routes for navigation.