Giter Site home page Giter Site logo

coccor / ngx-tiny-slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vdanyliv/ngx-tiny-slider

0.0 0.0 0.0 1.06 MB

Angular wrapper for tiny-slider

Home Page: https://npmjs.com/package/ngx-tiny-slider

License: MIT License

JavaScript 12.41% TypeScript 67.21% HTML 14.75% SCSS 5.63%

ngx-tiny-slider's Introduction

ngx-tiny-slider

Angular component that gives you possibility to use tiny slider library.

  1. Demo page

How to use

  1. npm i ngx-tiny-slider
  2. Import NgxTinySliderModule into your shared / root module
  3. Use in your component template use

Sandboxes

  1. Custom controls codesandbox.io
  2. Lazy loading / Wait for DOM codesandbox.io

Whats new on 1.0.2?

  1. Added lazy loading example
  2. Added domReady into NgxTinySliderInstanceInterface

Usage example

Your module definition example

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';

import {AppComponent} from './app.component';
import {NgxTinySliderModule} from 'ngx-tiny-slider';

@NgModule({
  imports: [
    BrowserModule,
    NgxTinySliderModule
  ],
  declarations: [
    AppComponent
  ],
  exports: [
    NgxTinySliderModule
  ],
  providers: [],
  bootstrap: [
    AppComponent
  ]
})
export class AppModule {
}

Your component definition example

import {Component, OnInit} from '@angular/core';
import {NgxTinySliderSettingsInterface} from 'ngx-tiny-slider';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
tinySliderConfig: NgxTinySliderSettingsInterface;

ngOnInit() {
  this.tinySliderConfig = {
    arrowKeys: true,
    autoWidth: true,
    gutter: 10,
    controlsText: ['<', '>']
  };
}
}

Your component template example

<ngx-tiny-slider [config]="tinySliderConfig">
    <ng-container class="items">
      <div class="item">
        <a target="_blank" href="google.com">
          <img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
        </a>
      </div>

      <div class="item">
        <a target="_blank" href="google.com">
          <img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
        </a>
      </div>

      <div class="item">
        <a target="_blank" href="google.com">
          <img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
        </a>
      </div>

      <div class="item">
        <a target="_blank" href="google.com">
          <img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
        </a>
      </div>

      <div class="item">
        <a target="_blank" href="google.com">
          <img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
        </a>
      </div>
    </ng-container>
  </ngx-tiny-slider>

Additional options

  1. domReady {Subject} - provide possibility to initialize component manually

ngx-tiny-slider's People

Contributors

vdanyliv avatar pieterqq avatar erickmcarvalho avatar m1kl avatar richu98 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.