jQuery-UI DatePicker 无法与 Aurelia 和 Typescript 一起使用

jQuery-UI DatePicker not working with Aurelia and Typescript

我正在尝试围绕 jQuery UI DatePicker 创建包装器(自定义属性)。 date-picker.ts 目前看起来如下所示:

import {inject, bindable} from "aurelia-framework";

export class DatePickerCustomAttribute {
   static inject = [Element];

   @bindable isdate;

   constructor(public element:Element) {
   }

   bind() {
       if (this.isdate) {
           console.log("trying to set datepicker");
           $(this.element).datepicker();
       }
   }

}

用法:

<require from="./date-picker"></require>
...
<input ... date-picker="isdate.bind:isDate"/>

这适用于 Chrome,但不适用于 Firefox 或 Edge。代码在执行此行时抛出错误:$(this.element).datepicker();。错误说:Error: Assertion failed

我的开发设置:Visual Studio 2015 - Aurelia - Typescript 1.5.4 - 以及必要的类型定义,例如 aurelia,jQuery,jQueryui, and jQuery-ui-datetimepicker.

请求帮助和建议。

谢谢。

编辑: 堆栈跟踪是这样的:

Stack trace: 
assert@https://localhost:44300/Scripts/webcomponents.js:112:21
assertIsNodeWrapper@https://localhost:44300/Scripts/webcomponents.js:1573:7
.insertBefore@https://localhost:44300/Scripts/webcomponents.js:1787:9
.appendChild@https://localhost:44300/Scripts/webcomponents.js:1784:16
.buildFragment@https://localhost:44300/Scripts/jquery-2.1.4.js:5150:18
.domManip@https://localhost:44300/Scripts/jquery-2.1.4.js:5387:15
.append@https://localhost:44300/Scripts/jquery-2.1.4.js:5218:1
$.fn.datepicker@https://localhost:44300/Scripts/jquery-ui-1.11.4.js:5811:3
DatePickerCustomAttribute</DatePickerCustomAttribute.prototype.bind@https://localhost:44300/aureliaviews/shared/date-picker.js:19:17
.......

webcomponents.js(聚合物)导致了这个问题。尝试删除对该库的依赖。更多疑难解答提示:

https://github.com/webcomponents/webcomponentsjs/issues/301