I"m trying to make iscroll work with ionic.
I installed the iscroll package using:
npm install iscroll --save
as the result, iscroll subfolder was added into the node_modules folder
I installed
@types/iscrollusing:npm install @types/iscroll --save
as the result, iscroll subfolder was added into the node_modules/@types folder
- 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');
}
}
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.