Im trying to get a simple datepicker to work in aurelia but I think I have missed something really basic here.
Im using the aurelia skeleton with webpack here
https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript-webpack
After this I assume its installing Jquery-ui that is next.
http://ilikekillnerds.com/2016/02/using-jquery-ui-widgets-in-aurelia/
Looking here it all seems simple. But no matter what I do I keep getting "[ts] Cannot find module 'jquery-ui'" on this row
import { datepicker } from "jquery-ui";
I cant figure out how to get the module working correctly.
npm install jquery
npm install jquery-ui
tsd install jquery
tsd install jqueryui
Anything else missing here?
Since I use webpack I dont need any jspm magic? Or so I thought?
Edit: Adding a module dependency in Aurelia with Webpack
Here it looks like
npm install jquery-ui --save
is all I need. Still same problem
Edit: Complete datepicker.ts code
import { customElement, bindable, inject } from "aurelia-framework";
import "jquery";
import { datepicker } from "jquery-ui";
@customElement('jquery-ui-datepicker')
@inject(Element)
export class JqueryUiDatepicker {
@bindable id = '';
@bindable name = '';
@bindable options = {};
constructor(Element) {
this.element = Element;
if (!this.id && this.name) {
this.id = this.name;
}
if (!this.name && this.id) {
this.name = this.id;
}
}
attached() {
$(`#${this.id}`).datepicker(this.options)
.on('change', e => {
let changeEvent = new CustomEvent('input', {
detail: {
value: e.val
},
bubbles: true
});
this.element.dispatchEvent(changeEvent);
});
}
detached() {
$(`#${this.id}`).datepicker('destroy').off('change');
}
}
import from "jquery-ui/datepicker"- Fabio Luz{ datepicker }part of the import statement is not really necessary, since jquery-ui does not export anything as far as I know. Have you tried to remove it? - Fabio Luz