angular 2 - making a modular datepicker component -


i've been reading on transclusion , i'm trying figure if that's need in order make popup picker service can dropped in anywhere.

because ngx-bootstrap not yet support modal date-picker, i'm making own. have multiple datepickers throughout app, several on same page, want modular possible.

i start standard date input:

<input      type="date"      class="form-control"      (click)="pickdate($event, '#requestdate')" /> 

at moment, datepicker right in page (postioned absolute, behaves popup):

<datepicker      id="requestdate"      name="requestdate"      [(ngmodel)]="incident.absence.requestdate"      required></datepicker> 

... expect service generate as-needed.

the method far:

pickdate(e, popupid) {     e.preventdefault();     var popupctrl = this.elementref.nativeelement.queryselector(popupid);     popupctrl.style.display= 'block'; } 

there's going lot of communication between input , datepicker passing init , modified date , forth. presumably, simple transclusion isn't sufficient.

how service work generates control on page?

(or re-inventing wheel here?)

while write own wrapper datepicker sounds more work need do. sounds using ngx-bootstrap if wanted custom datepicker put date picker in dropdown or tooltip control provide.

realistically, use datepicker primeng: https://www.primefaces.org/primeng/#/calendar

it shouldn't matter using multiple ui frameworks (primeng , ngx-bootstrap) because bloat should shaken out in prod build.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -