How to use ngx-lottie - 3 common examples

To help you get started, we’ve selected a few ngx-lottie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngx-lottie / ngx-lottie / src / server / src / internals.ts View on Github external
function transferAnimationData(
  state: TransferState,
  animation: AnimationFilename,
  animationData: AnimationData
): void {
  animation = transformAnimationFilenameToKey(animation);
  const key = makeStateKey(animation);
  state.set(key, JSON.parse(animationData));
}
github ngx-lottie / ngx-lottie / integration / app / app.module.ts View on Github external
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { LottieModule } from 'ngx-lottie';

import { AppComponent } from './app.component';

export function playerFactory() {
  return import('lottie-web');
}

@NgModule({
  imports: [
    BrowserModule.withServerTransition({ appId: 'ngx-lottie-universal' }),
    BrowserTransferStateModule,
    HttpClientModule,
    LottieModule.forRoot({
      player: playerFactory,
      useCache: true
    })
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}
github ngx-lottie / ngx-lottie / integration / app / app.server.module.ts View on Github external
import { NgModule } from '@angular/core';
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
import { LottieServerModule } from 'ngx-lottie/server';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    AppModule,
    ServerModule,
    ServerTransferStateModule,
    LottieServerModule.forRoot({
      preloadAnimations: {
        folder: 'dist-integration/assets/animations',
        animations: ['data.json']
      }
    })
  ],
  bootstrap: [AppComponent]
})
export class AppServerModule {}

ngx-lottie

<table> <thead> <tr> <th>ngx-lottie</th> <th>Angular</th> </tr> </thead> <tbody> <tr> <td> 7.x </td> <td> >= 8 < 13 </td> </tr> <tr> <td> 8.x </td> <td> 13 </td> </tr> <tr> <td> 9.x </td> <td> 14 </td> </tr> <tr> <td> 10.x </td> <td> 15 </td> </tr> <tr> <

MIT
Latest version published 11 days ago

Package Health Score

78 / 100
Full package analysis