-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular adapter #627
Angular adapter #627
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit d005782. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #627 +/- ##
==========================================
+ Coverage 88.82% 88.86% +0.04%
==========================================
Files 28 32 +4
Lines 814 844 +30
Branches 188 189 +1
==========================================
+ Hits 723 750 +27
- Misses 84 87 +3
Partials 7 7 ☔ View full report in Codecov by Sentry. |
2585d62
to
d39dd92
Compare
Per a conversation with @alxhub at ngConf, the API has shifted from: <ng-template
[tanstackField]="form"
name="firstName"
[validators]="{ onChange: required }"
let-field
>
<label>
<div>First name:</div>
<input
[value]="field.state.value"
(blur)="field.handleBlur()"
(input)="field.handleChange($any($event).target.value)"
/>
</label>
<div *ngFor="let error of field.state.meta.errors" style="color: red">
{{ error }}
</div>
</ng-template> To: <ng-container
[tanstackField]="form"
name="firstName"
[validators]="{ onChange: required }"
#f="field"
>
<label>
<div>First name:</div>
<input
[value]="f.api.state.value"
(blur)="f.api.handleBlur()"
(input)="f.api.handleChange($any($event).target.value)"
/>
</label>
<div *ngFor="let error of f.api.state.meta.errors" style="color: red">
{{ error }}
</div>
</ng-container> This should have better performance heuristics as well as a nicer DX |
Co-authored-by: Rafael Mestre <277805+rlmestre@users.noreply.github.com>
Co-authored-by: Alex Rickabaugh <alx+alxhub@alxandria.net>
1ad102f
to
02a07ac
Compare
c3bdf7f
to
221ccff
Compare
This PR starts an initial Angular adapter that has an API like so:
This should work with any of the adapters (Zod) OOTB day 1.
This is still WIP despite working as we're waiting for:
This API was directly inspired by conversations I had with @nartc who brainstormed the initial API. Thank you!