0
私のアプリケーションでJQueryスライダを使用しようとしていますが、JQueryだけで試してみるとうまくいきますが、typescriptで作成したangleディレクティブで使用すると、このように表示されます。ここではtypescript angleディレクティブのJQueryスライダが正しく表示されない(C#)
はディレクティブです:
SliderDirective.$inject = ["$window"];
function SliderDirective($window: ng.IWindowService): IMediaDirective {
return {
restrict: "EA",
link: link
}
function link(scope: IMediaDirectiveScope, element: ng.IAugmentedJQuery, attrs: IMediaDirectiveAttributes) {
element.slider({
range: true,
min: 10,
max: 100,
value: 50,
slide: (event: Event, ui: JQueryUI.SliderUIParams) => {
scope.$apply(function() {
scope[attrs.ngModel] = ui.value;
});
}
})
}
}
angular.module("mediaApp").directive("slider", SliderDirective);
HTMLテンプレート:
他の指令は、必要なように機能しています。また、私はVS 2015、jqueryui.d.tsとangular.d.tsをDefinitelyTypedから使用しています
ありがとうございました!