ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

feat(datepicker): There is a way of use datepickers in reactives forms?

Open jlberrocal opened this issue 10 years ago • 24 comments

Actually i need to use validators on each form, so i was wondering if there is a way of use FormControl instead of ngModel, thanks in advance.

jlberrocal avatar Aug 25 '16 18:08 jlberrocal

I also have this problem.

sublime392 avatar Sep 21 '16 18:09 sublime392

I think this is related to https://github.com/valor-software/ng2-bootstrap/issues/893 and https://github.com/valor-software/ng2-bootstrap/issues/959

Martin-Luft avatar Sep 22 '16 07:09 Martin-Luft

https://github.com/valor-software/ng2-bootstrap/pull/1023

Martin-Luft avatar Sep 23 '16 14:09 Martin-Luft

Is there a way to use datepicker in reactive form?

Kosmonaft avatar Oct 07 '16 02:10 Kosmonaft

Actually i need to use validators on each form, so i was wondering if there
is a way of use FormControl instead of ngModel, thanks in advance.

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/valor-software/ng2-bootstrap/issues/893

sioquim avatar Oct 07 '16 02:10 sioquim

+1

sublime392 avatar Nov 03 '16 09:11 sublime392

I need this too. :(

GuskiS avatar Nov 17 '16 22:11 GuskiS

@GuskiS If you need a workaround: I had to pull in the PrimeNG library to get a datepicker I can use with reactive forms.

sublime392 avatar Nov 18 '16 13:11 sublime392

@iherbivore Thanks, I will look into.

GuskiS avatar Nov 18 '16 15:11 GuskiS

Sweet, any ideas when this gonna be NPM?

GuskiS avatar Dec 07 '16 17:12 GuskiS

I need to add new injection service, to work with 2.2+

valorkin avatar Dec 07 '16 17:12 valorkin

With out hacks

valorkin avatar Dec 07 '16 17:12 valorkin

I'm anxious to see this change released as well, and there is the same issue with the typeahead control...

glitchbane avatar Dec 31 '16 23:12 glitchbane

BTW date picker should work with reactive forms in latest versions New injection service released, you can check popover implementation.

valorkin avatar Jan 01 '17 10:01 valorkin

I tried it in v1.1.16-7 and it wasn't working when used like this:

  <datepicker [formControlName]='field.name' [name]='field.name' ...></datepicker>

because name wasn't valid attribute for datepicker, but I need the name.

GuskiS avatar Jan 01 '17 11:01 GuskiS

Update came somewhere 16-9+

valorkin avatar Jan 01 '17 11:01 valorkin

i want to use timepicker with formControlname="time", but get NaN as a value. Is this because it's not supported or i'm doing something wrong?

elmartino avatar Jan 22 '17 14:01 elmartino

Facing the same issue. If it's working with the newest version, so that would would be nice to have a working plunkr as example and updated documentation as well.

stephsavoie avatar Feb 03 '17 13:02 stephsavoie

<datepicker formControlName="license_expire_date" [formControl]="registerFormProvider.controls['license_expire_date']" name="license_expire_date"></datepicker>

throws: 'datepicker' is not a known element:

I'm also facing the same problem any solution to this ?

touqeershafi avatar Mar 27 '17 20:03 touqeershafi

Any news?

xcesco avatar Jul 03 '17 11:07 xcesco