chenqingspring / ng-lottie

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

iOS 10.2.1 is not showing the animated svgs #6

Open timdoes opened 7 years ago

timdoes commented 7 years ago
iOS: 10.2.1 (14D27)
node: 7.7.4
npm: 4.2.0
@angular/cli: 1.0
@angular/core: 4.0
lottie-angular2: 0.0.6

I am able to see/play/load the animations on all major browsers and devices except for any browser on the iPhone iOS version above.

Is this something anyone else is experiencing?

timdoes commented 7 years ago

Also, running ng build --prod --aot for Ahead-of-Time compilation throws this error:

ERROR in /node_modules/lottie-angular2/dist/esm/src/lottieAnimationView.component.ngfactory.ts (1,1): Property 'viewWidth' is private and only accessible within class 'LottieAnimationViewComponent'.
/node_modules/lottie-angular2/dist/esm/src/lottieAnimationView.component.ngfactory.ts (1,1): Property 'viewHeight' is private and only accessible within class 'LottieAnimationViewComponent'.

on the following:

@angular/cli: 1.0.0
node: 7.7.4
os: darwin x64
@angular/animations: 4.0.0
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0
@angular/language-service: 4.0.0
@angular/service-worker: 1.0.0-beta.8
timdoes commented 7 years ago

I can open up a separate issue for that if you'd like :)

chenqingspring commented 7 years ago

I think it's different issue.. I haven't test it on angular4 yet

timdoes commented 7 years ago

After some research, I found out that private variables do not work in templates with AOT builds as they exist outside the component class. See here

Let me know if you would like to support AOT builds and I can create a PR either making viewHeight and viewWidth public (don't see the harm) or creating a getter for the values in the template :)

chenqingspring commented 7 years ago

Thanks for your investigation.

Please feel free to PR it. I'll merge and patch it as 0.0.7

HarshitChhipa commented 3 years ago

We are still not able to see the animation in IOS. When we navigate the animation disappears.