-1

Does anyone know how to get jQuery UI date picker working in an AngularJS 2 app?

I've used jQuery UI date picker before in AngularJS 1.

JAL
  • 41,701
  • 23
  • 172
  • 300
AngularM
  • 15,982
  • 28
  • 94
  • 169

1 Answers1

1

You could do the following.

import {Component, OnInit, View} from 'angular2/core';
import {FORM_DIRECTIVES, CORE_DIRECTIVES} from 'angular2/common';

@Component({
   selector:'calendar',
   template:'<h3>calendar</h3><div id="calendar"></div>'
})
export class jQCalendar implements OnInit{

  constructor(){}
  ngOnInit(){
    var calendar =  (<HTMLSelectElement>document.getElementById('calendar'));
    $(calendar).datepicker();
  }

}

Here is a plnkr http://plnkr.co/edit/92E0Er6kUxIS4E8hRgwI?p=preview

inoabrian
  • 3,762
  • 1
  • 19
  • 27