Import anime library

Hi,

I’m trying to import animejs library (https://github.com/juliangarnier/anime/) to my app. I have already put <script src="build/anime.min.js"></script> in my www/index.html, but now I don’t know how to import it to my ts file (for example: home.ts)
I have tried import { anime } from 'anime.min.js'; but no luck. Please help!

Are you using Ionic 2.x or higher? AnimeJS is a JavaScript library, you will need to find a TypeScript library for this.

I’ve tried to install animejs using npm and it’s working now. However, I’m still wondering how we can import library directly by js file.

Because you need the ng2 version of Animejs (if any).

Anyway, try this code:

import * as anime from 'animejs';