Integrating JavaScript animation frameworks like GreenSock into Ionic

Hey guys,

Looking to integrate a JavaScript animation framework into Ionic 2 but am having a little trouble on where exactly to place everything. Unfortunately it doesn’t look like it’s as simple as just dropping in a bunch of script tags in.

Some of the solutions I’ve seen online for implementation with Angular 2 don’t seem to cross over to Ionic 2, especially since there’s no bootstrapping?

Anyone have any experience with this sort of thing?

That looks like a really broad target, and maybe you would get more targeted advice if you narrowed down something specific you were trying to do. That being said, the general pattern for interfacing with libraries like this consists of:

  • get a handle to an object from the library. this step is very dependent on your packager: I use webpack, Ionic prefers browserify

  • grab a DOM element, generally using @ViewChild

  • pass step 2 to step 1

Here is an example of doing this with Chart.js, that you might be able to crib from.

Great, I’ll take a look at the chart example.

Specifically, I’m trying to utilize GreenSock’s drag and drop functionality in my app

Just in case anyone is looking for a way to utilize Greensock in Ionic… here is a project for you:
https://github.com/vijtad/ionic2-gsap-greensock