justcommunication-ru / ngx-splide Goto Github PK
View Code? Open in Web Editor NEWSplide.js integration to angular
Splide.js integration to angular
Had found such an issue:
Trying to use that package in lazy-loaded module, error occurred:
"BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead."
Changing "BrowserModule" to "CommonModule" fixed that.
I suppose it could be useful to make that change in common package.
Thx.
The current version compiled against v10 it would be great to bump it to v14
How to use the sync functionality?
https://splidejs.com/guides/apis/#sync
Currently I have two Splide Sliders that need to be synced - one big with fullscreen images and one small with thumbnails used as navigation.
<splide (onInit)="onMainSplideInit($event)" class="splide mainSlider" [options]="{type: 'slide',pagination: false,arrows: false,drag: true,lazyLoad: 'nearby',preloadPages: 3}"> <splide-slide *ngFor="let media of data.media"> <div> // big img </div> </splide-slide> </splide> <splide (onInit)="onSecondarySplideInit($event)" class="splide secondarySlider" [options]="{ rewind: true, isNavigation: true, gap: 5, focus: 'center', pagination: false, cover: true, lazyLoad: 'nearby', preloadPages: 20, fixedWidth: 60, fixedHeight: 60 }"> <splide-slide *ngFor="let media of data.media"> <div> //thumbnail </div> </splide-slide> </splide>
and in the inInit functions i tried to sync them:
`onMainSplideInit = (splide) => {
this.mainSplide = splide;
}
onSecondarySplideInit = (splide) => {
this.secondarySplide = splide;
this.mainSplide.sync(this.secondarySplide).mount();
}`
this works partial - when I move the mainSlider the secondarySlider moves too, but not in the other direction...
Is there a proper way to implement this?
Hello @wiistriker - Thanks for the great library. I am using this library and everything works as expected. Although, you can add support for Ivy in this library as it gives a warning while we do ng serve after installing this library.
Looking forward to it.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.