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

angular4-carousel

v3.1.8

Published

Configurable angular2/4 carousel

Downloads

576

Readme

Angular4Carousel

Configurable angular carousel

Demo

http://angular4-carousel.bitballoon.com/

Getting started

npm i --save angular4-carousel

Add following lines into your

module:

import { CarouselModule } from 'angular4-carousel';

add carousel in your module imports section

imports: [CarouselModule]

component template:

add carousel and container

<div style="width: 800px; height: 400px">
  <carousel [sources]="imageSources" [config]="config"></carousel>
</div>

component ts:

import { ICarouselConfig, AnimationConfig } from 'angular4-carousel';

and add sources and config to component class

public imageSources: string[] = [
     'path to img1',
     'path to img2',
     'path to img3'
  ];
  
  public config: ICarouselConfig = {
    verifyBeforeLoad: true,
    log: false,
    animation: true,
    animationType: AnimationConfig.SLIDE,
    autoplay: true,
    autoplayDelay: 2000,
    stopAutoplayMinWidth: 768
  };

Add font awesome to your project.

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

(you can add font awesome using CLI or directly or CDN, or whatever you want, or redefine default styles for arrows ;) with pure CSS )

Config

verifyBeforeLoad values: false, true If true, each image will render to view if and when load. If false, all images render as soon as carousel init.

log: values: false, true Log to console on image load success or error

animation: values: false, true

animationType: value: AnimationConfig.APPEAR, AnimationConfig.SLIDE_OVERLAP, AnimationConfig.SLIDE

autoplay: values: false, true

autoplayDelay: values: [number] (ms)

stopAutoplayMinWidth: values: [number] (px) Prop for preventing autoplay on mobile devices. If window width (w/o scroll) <= value, autoplay will stop.

API

You can catch event on image loaded Add following lines into your component ts file:

Import: import { CarouselService } from 'angular4-carousel';

in constructor:

constructor (private x: CarouselService) {}

and use:

this.x.onImageLoad().subscribe(
      (src) => console.log(src + ' - loaded'),
      (src) => console.log(src + ' - error'),
      () => console.log('all imgs loaded')
    )