Make Angular combobox, date-select, etc. implement ControlValueAccessor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Here's a discussion item/request.
I propose that we change some of our Angular components so that they can be easily used with Angular's Reactive forms. I had the combobox, date-select, and org-select in mind. My understanding is that this would require us to implement ControlValueAcc
A plug for reactive forms: I've been experimenting with them lately. They are pretty handy to work with: I particularly appreciated their validation capabilities and how they create handy Observables for each field. Plus, Reactive Forms is a pretty popular way to create forms in Angular, so it's easy to find code examples.
My understanding is that implementing ControlValueAcc
Thoughts?
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
status: | New → Confirmed |
Changed in evergreen: | |
importance: | Undecided → Wishlist |
assignee: | nobody → Galen Charlton (gmc) |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Here's a proof of concept branch: https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ sandbergja/ lp1831390_ combobox_ date_select_ ControlValueAcc essor
user/sandbergja /lp1831390_ combobox_ date_select_ ControlValueAcc essor
This branch ControlValueAcc essor-izes combobox and date-select. It also includes a few sandbox examples, featuring date-select and combobox used with [(ngModel)], and combobox used with a reactive form and Angular validation.
I found this tutorial about ControlValueAcc essor very helpful: https:/ /blog.thoughtra m.io/angular/ 2016/07/ 27/custom- form-controls- in-angular- 2.html
Let me know what you think!