vdanyliv / ngx-tiny-slider

Angular wrapper for tiny-slider
https://npmjs.com/package/ngx-tiny-slider
MIT License
15 stars 18 forks source link

controlsContainer available to use? #24

Closed seanmavley closed 4 years ago

seanmavley commented 4 years ago

I'm not sure how to use the controlsContainer from the tiny-slider here

<ngx-tiny-slider [config]="blabla">

<ul id="customize-controls">
....
</ul>

<ng-container class="itmes">
 <div class="item">
 ....
</div>
</ng-container>
</ngx-tiny-slider

Then in component, as a field in the this.tinySliderConfig:

controlsContainer: "#customize-controls",

In browser, console, I get this:

core.js:6260 ERROR TypeError: Cannot read property '0' of undefined
    at initTools (tiny-slider.js:1060)
    at initSliderTransform (tiny-slider.js:767)
    at tns (tiny-slider.js:436)
    at NgxTinySliderService.initSlider (ngx-tiny-slider.js:18)
    at NgxTinySliderComponent.initSlider (ngx-tiny-slider.js:69)
    at NgxTinySliderComponent.ngOnInit (ngx-tiny-slider.js:49)
    at callHook (core.js:4758)
    at callHooks (core.js:4722)
    at executeInitAndCheckHooks (core.js:4662)
    at refreshView (core.js:11986)
seanmavley commented 4 years ago

@vdanyliv A sandbox for this too will be really appreciated. I keep getting errors.

vdanyliv commented 4 years ago

@seanmavley here is the simple example of custom controls https://codesandbox.io/s/ngx-tiny-slider-custom-controls-rhrq6