vdanyliv / ngx-tiny-slider

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

Example interface errors #33

Closed BenRacicot closed 3 years ago

BenRacicot commented 3 years ago

Hello, thank you for porting Tiny-Slider to Angular. This is enormously needed. :)

Regarding the title, my Stackblitz repro demonstrates that the NgxTinySliderSettingsInterface interface only includes one param. But the demo explicitly shows setting the config with many params and thus an error.

Could you help me get that Stackblitz going?

vdanyliv commented 3 years ago

@BenRacicot interface include next props:

export interface NgxTinySliderInstanceInterface {
  domReady: Subject<any>;
  sliderInstance: TinySliderInstance;
  slideItemsContainerRef: ElementRef;
}

what extra do you need?

BenRacicot commented 3 years ago

Hey @vdanyliv sorry I dont follow what you're saying.

interface include next props:

Thank you for pointing me to NgxTinySliderInstanceInterface but it does not contain arrowKeys:boolean

On this Github main page and the NPM page it explains to use the interface incorrectly, or so it seems. NgxTinySliderSettingsInterface is potentially misrepresented there.

Where you able to take a look at the Stackblitz which is not working with ngx-tiny-slider?

  // tinySliderConfig: NgxTinySliderSettingsInterface; // Github/NPM instructions
  tinySliderConfig: NgxTinySliderInstanceInterface;

  ngOnInit() {
    this.tinySliderConfig = {
      arrowKeys: true, // doesnt seem to exist on the interface?
      autoWidth: true,
      gutter: 10,
      controlsText: ["<", ">"]
    };
  }
vdanyliv commented 3 years ago

@BenRacicot NgxTinySliderSettingsInterface extends TinySliderSettings, clone my demo stackblitz, and enjoy. I will take a look at your stackblitz later (make sure that your stackblitz and angular project configured properly)