Hello! I just started learning GSAP today and I'm trying to use this with Angular 11. A while back (Angular 7?) it was very easy to import and use GSAP with Angular. Now it doesn't seem so. (I most probably just missed something.)
What's wrong with my code?
import { Component, ViewChild } from '@angular/core';
import { gsap } from 'gsap';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
constructor() {}
@ViewChild('box') box?: any;
ngAfterViewInit() {
gsap.to(this.box, { x: 100 });
}
}
It's returning this error:
Thanks! I'm looking forward to be very active in this community!