I have been attempting to incorporate anime.js into my Ionic 3 project, but I keep encountering an error when using the function anime({}) in the .ts file.
Error: Uncaught (in promise): TypeError: __webpack_require__.i(...) is not a
function
TypeError: __webpack_require__.i(...) is not a function...
...Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
The content of my animation.ts file is as follows:
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { trigger,state,style,transition,animate,keyframes } from '@angular/animations';
import { anime } from 'animejs';
@IonicPage()
@Component({
selector: 'page-animation',
templateUrl: 'animation.html',
})
export class AnimationPage {
state: string ="small";
constructor( public navCtrl: NavController, public navParams: NavParams) {
anime({
targets: '.animatable',
translateX: 250
});
}
animateThis(){
this.state=(this.state=='small'?'large':'small');
}
ionViewDidLoad() {
console.log('ionViewDidLoad AnimationPage');
}
}
If you require any additional information from other files to resolve this issue, please let me know!