Add GSAP animation library to Angular 2 Application

Pinterest LinkedIn Tumblr

A week ago I tried to do small animations in angular 2 app by GSAP library. The goal here is, gsap works with typescript compiler and we can use it as types in our angular app. The steps are easy and I summarize them into few ones:

  1. Do an “npm install –save @types/gsap”
  2. Include the gsap in the component or service “var gsap = require(‘gsap’)”
  3. Use it “var tl = new gsap.TimelineLite()”

If you are looking for TimelineMax class functionalities, you may need to convert them to types first and add it to your angular 2 app.