kevinoleary19 / Angular-2-Datepicker

A minimalist datepicker inspired by Google's material design
70 stars 71 forks source link

Add support controlvalue accessor #38

Open paulussup opened 7 years ago

paulussup commented 7 years ago

Hey great md component. What do you think about changing the date Input to a regular control value?

kevinoleary19 commented 7 years ago

thanks @paulussup ! What benefits does this approach have over having a Date be the source of truth? I'm hesitant to break the current api / functionality. Is it possible to add this in addition to the date?

paulussup commented 7 years ago

Quite a lot of benefits… basically you are able to use [(ngModel)] as the source of truth as opposed to rolling your own.

http://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html http://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html

Is quite informative on how to make custom form controls.

On 26 Nov 2016, at 6:43 PM, koleary94 notifications@github.com wrote:

thanks @paulussup https://github.com/paulussup ! What benefits does this approach have over having a Date be the source of truth? I'm hesitant to break the current api / functionality. Is it possible to add this in addition to the date?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koleary94/Angular-2-Datepicker/pull/38#issuecomment-263050763, or mute the thread https://github.com/notifications/unsubscribe-auth/AJCRmIYoG23scdA0LIeD1ZYSGWgcGtTTks5rB-oQgaJpZM4K6iS1.

kevinoleary19 commented 7 years ago

hey @paulussup . going to come back to this pr. going to focus on the open issues first