【问题标题】:space in style css in Angular-2+ animationsAngular-2+动画中样式css的空间
【发布时间】:2018-10-03 04:39:55
【问题描述】:

https://angular.io/guide/animations 在状态样式的 Angular 4 动画中为什么不支持前缀?

在这个小插曲中

https://plnkr.co/edit/ALfIp5nfno2uxBgXEBST

当我尝试添加 css 样式时

 animation-delay: 2s;

状态样式

 state('visible', style({ left: '0', transition: '650ms ease-in-out', })),

它给了我一个错误 (TypeScript ':' expected. (TS1005))

所以我想添加一些 css 规则来支持其他浏览器,比如 firefox(-moz 前缀),但它不接受任何前缀)

任何变通方法或解决方案?

【问题讨论】:

  • 你得到什么错误?
  • TypeScript ':' 预期。 (TS1005)

标签: angular typescript angular2-template angular2-forms


【解决方案1】:

在指南中

Angular 动画构建在标准 Web 动画 API 之上 并在支持它的浏览器上本地运行。

对于其他浏览器,需要使用 polyfill。取消注释 来自 polyfills.ts 文件的 web-animations-js polyfill。

这是这样写的,所以在 polyfill.ts 文件中取消注释 web-animations-js 并安装它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-20
    • 2023-04-04
    • 1970-01-01
    • 2019-05-21
    • 1970-01-01
    • 1970-01-01
    • 2016-07-24
    • 1970-01-01
    相关资源
    最近更新 更多