jssor with Angular 2 Typescript

前端 未结 1 1987
闹比i
闹比i 2021-01-25 08:36

I\'m developping a web site with Angular 2.

At this time I have purchased the subscription to Jssor to generate image slider for more than 3 separated sliders running in

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-25 09:05

    Brother I recently used Jssor, successfully, with Angular 2.

    In your index.html

    Required JSSOR JS file. Like these:-

      
                    OR
      
    

    Now in your component.ts use JSSOR like this

        import { Component,AfterViewInit } from '@angular/core';
    
    declare var jssor_1_slider_init:any;
    @Component({
        selector: 'ImageShow',
        template: `
            
        `,
    })
    export class ImageShowComponent implements  AfterViewInit{
        constructor(){
        }
        ngAfterViewInit() {
            jssor_1_slider_init();
        }
    }
    

    Edit:-

    jssor_1_slider_init is modified function name. Download this JavaScript file http://www.ravinderpayal.com/js/minified-player.js and search for the method name jssor_1_slider_init in this file. The code was modified by me for using multiple jssor slider in another project.

    Working demo:- http://www.ravinderpayal.com/dist

    0 讨论(0)
提交回复
热议问题