chenqingspring / ng-lottie

Render After Effects animations on Angular based on lottie-web
MIT License
340 stars 100 forks source link

Cached json in Angular 5 #32

Open tlaskowski opened 6 years ago

tlaskowski commented 6 years ago

Hi please check my init config method


initLottieLoader(isMainColor: boolean) {
    return {
      path: isMainColor ? 'assets/Dots-animation-w200-h200-white.json' : 'assets/Dots-animation-w200-h200-mustard.json' ,
      autoplay: true,
      loop: true,
    };
  }

Now every time when I am clicking on the button I have a lot od GET requests on network. How can I cache json?
jscti commented 6 years ago

+1 that

Here Angular 6 but this bug is present since I use lottie (1 yer, angular 5). JSON are not cached and re-requested every time (*each time a ngIf resolve to true ... ) , which is a problem.