UNPKG

ngx-lottie

Version:

<h1 align="center"> <img src="https://raw.githubusercontent.com/ngx-lottie/ngx-lottie/master/docs/assets/lottie.gif"> </h1>

24 lines 1.07 kB
import { Injectable } from '@angular/core'; import { TransferState, makeStateKey } from '@angular/platform-browser'; import { transformAnimationFilenameToKey } from './server'; import * as i0 from "@angular/core"; import * as i1 from "@angular/platform-browser"; export class LottieTransferState { constructor(transferState) { this.transferState = transferState; } get(animation) { const animationKey = transformAnimationFilenameToKey(animation); const stateKey = makeStateKey(animationKey); return this.transferState.get(stateKey, null); } } /** @nocollapse */ LottieTransferState.ɵprov = i0.ɵɵdefineInjectable({ factory: function LottieTransferState_Factory() { return new LottieTransferState(i0.ɵɵinject(i1.TransferState)); }, token: LottieTransferState, providedIn: "root" }); LottieTransferState.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ LottieTransferState.ctorParameters = () => [ { type: TransferState } ]; //# sourceMappingURL=transfer-state.js.map