Skip to content

feat: make datetime-picker usable in forms via implementing ControlValueAccessor #294

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

Closed
skriems opened this issue Jul 25, 2017 · 3 comments

Comments

@skriems
Copy link

skriems commented Jul 25, 2017

I'm submitting a ...

[ ] Bug report 
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit a support request here, please ask on https://stackoverflow.com/

Bug description / Feature request

datetime-picker.component can't be conveniently used in forms

Minimal reproduction of the problem with instructions

Using a reactive Form I'm not able to bind the component via formControlName. A ValueAccessor is needed

Versions

doesn't apply

Hey Matt,

first of all thanks for this awesome component!! It was fun working with it and exporing Angular 4.
There was just a little problem with your datetime-picker component I came across when using model driven Forms, so this request doesn't really apply to the angular-calendar itself. But as a reference I think your docs can benefit from that.

Since I'm not sure if this is desired here at all and everyone could write his own datetime-picker component which serves ones needs I'm just adding a reference for now to my version which implements ControlValueAccessor. Just let me know if you would like to cover this in your docs/examples. If I find some time I can create a PR then.

Feel free to close this right away since it's not a bug

dateime-picker component implementing ControlValueAccessor

@mattlewis92
Copy link
Owner

I don't see the harm in promoting best practises in the demo code, would you be so kind as to make a PR to this repo with these changes? Thanks! 😄

I believe this change would also allow the component to be used with ngModel which is a nice benefit as well.

@skriems
Copy link
Author

skriems commented Jul 25, 2017

exactly, that's what I'm doing in my code :)
Ok, I'll create a PR with these changes ASAP

@mattlewis92
Copy link
Owner

Awesome, thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants