我目前正在所有可能的瀏覽器中測試我的應用程序,並且我看到角動畫在Safari iOS 9.3中的行爲不像預期的那樣。經過幾小時 和幾小時試圖解決它我來請求幫助。提前致謝。Angular 4動畫不適用於Safari iOS 9.3
我的代碼如下:
的package.json
"dependencies": {
"@angular/animations": "^4.3.2",
"@angular/cdk": "^2.0.0-beta.8",
"@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.8",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ngx-meta/core": "^0.4.0-rc.2",
"@ngx-translate/core": "^7.1.0",
"@ngx-translate/http-loader": "^1.0.1",
"angular2-moment": "^1.6.0",
"core-js": "^2.4.1",
"express": "^4.15.4",
"lodash": "^4.17.4",
"ng2-pdf-viewer": "^1.1.1",
"ng2-translate": "^5.0.0",
"rxjs": "^5.4.1",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.14"
},
landing.component.ts
import { Component, HostBinding, ChangeDetectionStrategy } from '@angular/core';
import { stateTransition } from '../routing.animations';
@Component({
selector: 'cp-landing',
templateUrl: './landing.component.html',
styleUrls: ['./landing.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [ stateTransition() ]
})
export class LandingComponent {
@HostBinding('@stateTransition') '';
}
routing.animations.ts
import { trigger, state, animate, style, transition } from '@angular/animations';
export function stateTransition() {
return trigger('stateTransition', [
state('void', style({
transform: 'translateY(50%)',
opacity: 0
})),
state('*', style({
transform: 'translateY(0%)',
opacity: 1
})),
// enter animation
transition('void => *', animate('.5s 500ms')),
// exit animation
transition('* => void', animate('.5s'))
]);
}
我試過了一個小提琴,但我無法重現錯誤。
我做到了這一點,並降低了@ angular/platform-browser的工作效果,但最終動畫完全停止工作。有任何想法嗎? html元素只是獲得最終所需的屬性,但沒有任何動畫。 –