spirit
spirit copied to clipboard
gsap not found in Angular project
I have an Angular project and I am trying to import a Spirit animation.
I have installed the spirit npm package via npm i spiritjs
I have added the script to the list of loaded scripts "scripts": ["./node_modules/spiritjs/dist/spirit.js"]
Now, when I try to import the module into one of my modules and use it in appComponent: import * as spirit from 'spiritjs';
constructor() { spirit.loadAnimation({...}) }
TS throws 2 errors: ERROR in node_modules/spiritjs/spiritjs.d.ts(1,64): error TS2307: Cannot find module 'gsap'. src/app.component.ts(24,12): error TS2339: Property 'loadAnimation' does not exist on type 'SpiritStatic'.
I assume that you loaded the wrong package.
This is the spirit webserver. The animation tool "spirit" is there.