Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
?Unknown authorNov 24, 2026, 3:33 PM

Every day you should be thankful for signal forms allowing such easy cross field validation

Remember the mess we made with Reactive Forms?

#Angular #SignalForms #TypeScript #WebDev

form(this.passwords, (f) => {
  validateTree(f, ({ value }) =>
    value().password !== value().confirm
      ? { kind: 'mismatch', fieldTree: f.confirm }
      : null
  );
});
?Unknown authorNov 12, 2026, 4:48 PM

Another great thing Signal Forms gave us is saying goodbye to `ControlValueAccessor`

#Angular #SignalForms #WebDev

Angular code in a dark editor tab named star-rating.ts. A StarRating component has a template that loops over stars 1 to 5 with @for, rendering a button for each one. A button gets the class "on" when its star is less than or equal to value(), is disabled when disabled() is true, and calls value.set(star) when clicked. The class (highlighted) implements FormValueControl<number> and has just two members: value = model(0) and disabled = input(false). Below, a ReviewPage component imports FormField and StarRating and uses <star-rating [formField]="reviewForm.rating" /> in its template. It has a review signal with rating 0 and an empty comment, and reviewForm = form(this.review, ...) with a rule min(path.rating, 1) and the message "Pick at least one star".
?Unknown authorNov 11, 2026, 10:17 AM

Signal forms are INCREDIBLY cool

If you use (as you should) the `submit` function to submit your signal forms, it can call your API, and turn server errors into inline form field errors (plus block double submits) for you: just return a correct interface

#Angular #SignalForms #WebDev

Angular TypeScript code in a dark editor tab named signup.ts. A Signup component with a template: a form whose submit event calls save($event), an email input bound with formField, a loop showing the email field's error messages, a password input, and a button that reads "Saving…" while signup().submitting() is true and "Sign up" otherwise (highlighted). The class injects AccountApi and creates a signal form with email and password, validating the email format and requiring the password. The save method prevents the default submit and calls submit(this.signup, async (f) => ...) (highlighted). Inside, it calls this.api.register with the form value. If the result's error is EMAIL_TAKEN, it returns an array with one error object: fieldTree: f.email (highlighted), kind: 'server', message: 'This email is already registered'. Otherwise it returns undefined.