ivkan / ts-ion-rangeslider

Cool, comfortable and easily customizable range slider.
3 stars 4 forks source link

ERROR TypeError: ts_ion_rangeslider__WEBPACK_IMPORTED_MODULE_2___default(...).Slider is not a constructor #2

Closed andreidiaconescu closed 1 year ago

andreidiaconescu commented 1 year ago

Hello,

I am trying to use ts-ion-rangeslider in angular 15 like this:

HTML:

TS: ngOnInit() { new TsIonRangeSlider.Slider(document.querySelector('#range_slider_123'), {}); }

and i get error:

 ERROR TypeError: ts_ion_rangeslider__WEBPACK_IMPORTED_MODULE_2___default(...).Slider is not a constructor
    at RangesliderComponent.ngOnInit (rangeslider.component.ts:58:5)
    at callHook (core.mjs:2434:22)
    at callHooks (core.mjs:2403:17)
    at executeInitAndCheckHooks (core.mjs:2354:9)
    at selectIndexInternal (core.mjs:9059:17)
    at Module.ɵɵadvance (core.mjs:9042:5)
    at InsuranceCarModalComponent_Template (insurance-car-modal.component.html:630:16)
    at executeTemplate (core.mjs:10441:9)
    at refreshView (core.mjs:10326:13)
    at refreshComponent (core.mjs:11385:13)

Any clues please ? thank you.

ivkan commented 1 year ago

Hi Just published a new version (0.2.2) that I'm hoping will fix this. Let me know if that works for you. Import usage example:

import TsIonRangeSlider from 'ts-ion-rangeslider';

ngAfterViewInit(): void
{
        const input = document.getElementById('example') as HTMLInputElement;
        const slider = new TsIonRangeSlider.Slider(input);
}