Anime: How to use in Angular 2+

Created on 26 Nov 2017  路  3Comments  路  Source: juliangarnier/anime

Hi, great work! Thanks.

Is it possible to use anime in a Angular 2+ project? Would love to use if there. Any ideas hoe?

Most helpful comment

@whyboris
Hi, i got a problem after following your step
screen shot 2018-03-07 at 17 54 49

My dependencies version
screen shot 2018-03-07 at 17 55 35

OK, You know what? It solved...

Here's the solution:

  • Install package @types/animejs
  • Change your import syntax into
    import * as anime from 'animejs';
  • 120/100 happiness 馃槃

All 3 comments

Worked out for me:

_package.json_

    "animejs": "2.2.0",

_some.component.ts_

import anime from 'animejs';
...
something: any;
...
ngAfterViewInit(): void {
  this.something = anime({...});
}

Key aspect is that the code should run _AfterViewInit_ (see StackOverflow)
Please comment if you have any trouble.

@whyboris
Hi, i got a problem after following your step
screen shot 2018-03-07 at 17 54 49

My dependencies version
screen shot 2018-03-07 at 17 55 35

OK, You know what? It solved...

Here's the solution:

  • Install package @types/animejs
  • Change your import syntax into
    import * as anime from 'animejs';
  • 120/100 happiness 馃槃

thanks man

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ndimatteo picture ndimatteo  路  5Comments

Crashtor picture Crashtor  路  5Comments

PierBover picture PierBover  路  6Comments

edenprojectde picture edenprojectde  路  5Comments

gaou-piou picture gaou-piou  路  6Comments