Hey, I've wondered on how you can use GSAP with Angular2 if anyone here have done that.
I loaded the TimelineMax.min.js in my main index.html-file, but having problem importing it into a component.
My component look like this:
import {Component} from 'angular2/core';
//import {TweenLite} from 'gsap/src/minified/TweenLite.min.js';
//import {TimelineMax} from 'gsap/src/minified/TimelineMax.min.js';
//import {TL} from 'gsap/src/minified/TimelineMax';
import {TL} from 'gsap/src/uncompressed/timelinemax';
@Component({
selector: 'opning',
templateUrl: './components/opning/opning.html',
styleUrls: ['./components/opning/opning.css']
})
export class OpenCmp {
constructor() {
console.log("played");
console.log(TL);
// console.log(TweenLite);
// var tl = new TimelineMax();
/*var logo = $("#logo");
tl.from(logo, 4, { z: 500, y: 74, visibility: "visible" });
//tl.from(logo, 2, { left: "632px" });
tl.play();
*/
}
}
I installed gsap with npm install gsap so it is in my projects /node_modules/ .
Have tried several approaches, but i can not set tl = New TimelineMax() in that typescript class and I dont know how to load\import it. Anyone done this with angular2 ? I used this as my starting point: https://github.com/mgechev/angular2-seed