Ionic 3 with iscroll

326 Views Asked by At

I"m trying to make iscroll work with ionic.

  1. I installed the iscroll package using:

    npm install iscroll --save
    

as the result, iscroll subfolder was added into the node_modules folder

  1. I installed @types/iscroll using:

    npm install @types/iscroll --save
    

as the result, iscroll subfolder was added into the node_modules/@types folder

  1. I can import iscroll and use it in the code like:

import 'iscroll';
    
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage implements OnInit {
  iScroll: IScroll;
    
  ngOnInit(){
   this.iScroll = new IScroll('#wrapper');
  }
}

  1. I run

    ionic serve
    

It does not work!

It starts working only when I add a script tag in my index.html, like:

<script src="assets/dist/iscroll.js"></script>

The problem is: in the case when I have the script tag, I have duplicates in www folder: one "version" of the script is stored inside assest/dist folder and another "version" (which looks the same) is stored inside vendor.js.

0

There are 0 best solutions below