npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-min-carousel

v0.0.4

Published

A simple and lighweight carousel for Angular projects which provisions only typescript handlers, so the underlying stlying is truly yours.

Downloads

3

Readme

NgMinCarousel

A simple and lighweight carousel for Angular projects which provisions only typescript handlers, so the underlying stlying is truly yours.

Usage

To install the package,

npm i ng-min-carousel

Before initialising a project, add NgMinCarouselModule to your imports in AppModule.

Adding to your template

<ng-carousel [config]="config" 
    (init)="subscribeInitEvent()"
    (beforeChange)="subscribeBeforeChangeEvent()" 
    (afterChange)="subscribeAfterChangeEvent()">
<ng-slide></ng-slide>
<ng-slide></ng-slide>
<ng-slide></ng-slide>
<ng-slide></ng-slide>
<ng-slide></ng-slide>
</ng-carousel>

Add ngSlide to all divs you want to include in the carousel

Documentation

Config Options

| Attribute | typeof | Significance | Default | | --- | --- | --- | --- | | auto | boolean | Auto sliding of carousel | false | | duration | number | Time interval between auto sliding components | required | | transitionTime | number | Number of seconds for sliding transition animation | 0.5s | | useSwiping | boolean | Implement swiping using HammerJS | not enabled | | slideToSkip | number | Number of slides to skip through | computed based on width |

Important: Add HammerJS to your project for while enabling the useSwiping option.

Methods

Move the carousel to the right

NgMinCarouselService.right();

Move the carousel to the left

NgMinCarouselService.left();

Adding a new slide to the carousel

NgMinCarouselComponent.addSlide(el)

el is type of NgSlideDirective

Removing a slide from the carousel

NgMinCarouselComponent.removeSlide(el)

Seting the slide number

NgMinCarouselComponent.setCurrentSlideNumber(number)

where number is the slide number and it starts from 0

Get the current slide number

NgMinCarouselComponent.getCurrentSlideNumber()

Resetting the carousel

NgMinCarouselComponent.reset()

Updating the slides to skip config variable

NgMinCarouselComponent.updateSlideToSkip(number)

Binding to events

Events that can be binded to | Variable name | Significance | | --- | --- | | init| Initialised the carousel | | beforeChange | Before a change takes place | | afterChange | After a change takes place |

Event names | Event name | Significance | | --- | --- | | NgMinCarouselInit | Carousel has been initialised | | NgMinCarouselReset | Reset the carousel | | NgMinCarouselUpdateSlideNumber | Updating the slide number | | NgMinCarouselAddSlide | Adding a new slide to the carousel | | NgMinCarouselRemoveSlide | Removing a slide from the carousel |

Binding to observable

Bind to the observable to get the new slide number every time the slide changes

NgMinCarouselComponent.currentSlide.subscribe((val) => {})