Angular 2/4 - How to install ScrollMagic with Gsap?

Viewed 1187

I have a simple question:

How to use properly in an angular-cli application, ScrollMagic and Gsap?

What I have done:

npm install ScrollMagic

npm install gsap

In angular-cli.json:

"scripts": [
  "../node_modules/gsap/src/uncompressed/tweenmax.js",
  "../node_modules/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js",
  "../node_modules/scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap.js",
  "../node_modules/scrollmagic/scrollmagic/uncompressed/plugins/debug.addindicators.js"
],

in my component:

import {TweenLite, Power2, TimelineMax, TweenMax} from "gsap";
import * as ScrollMagic from 'ScrollMagic';
import * as $ from 'jquery';
import 'scrollmagic/scrollmagic/uncompressed/plugins/animation.gsap';
import "scrollMagic/scrollmagic/minified/plugins/debug.addIndicators.min.js";

But this doesn't work. I get an error.

Has somebody already installed the plugin on his angular 2 app?

Thanks.

1 Answers
Related