Angular Animation在路由到外部模块时出错[Cannot read property 'play&
Angular Animation error when routing to external module [Cannot read property 'play' of undefined]
我有使用Angular动画加载到DOM中的组件。当路由器出口和路由属于同一个父模块时,路由器链接才能正常工作。当我点击一个路由链接导航到一个交叉模块时,我得到了这个错误。
module A ->所有路由都使用动画
module B ->所有路由都使用动画
模块B到模块A的路由-> errors
logging-error-handler.js:37无法读取未定义的属性'play'
logging-error-handler.js:37 Uncaught (in promise):在"Element"上执行"animate"失败:不支持部分关键帧。
我认为这可能与动画不知道要看哪个路由器出口有关。然而,我认为void
关键字是一个特殊的关键字,当找到时会解析。
animations: [
trigger('routeAnimation', [
state('*',
style({
opacity: 1
})
),
transition('void => *', [
style({
opacity: 0,
transform: 'translateX(-100%)'
}),
animate('0.8s ease-in')
]),
transition('* => void', [
animate('0.8s ease-out', style({
opacity: 0,
transform: 'translateY(100%)'
}))
])
])
]
我通过在模块a和模块b中添加假动画来修复这个问题。
animations: [
trigger('routeAnimation', [])
]
这不是一个漂亮的解决方案,但对我有用
相关文章:
- 为什么JavaScript可以'找不到给定的InnerHTML并返回Cannot set property
- 未捕获TypeError: Cannot read property 'geocode'未定义的'
- SailsJs中的错误.TypeError: Cannot read property '的定义
- 未捕获的TypeError: Cannot read property 'top'的定义
- 未捕获的TypeError: Cannot read property '未定义的数据表
- 未捕获的TypeError: Cannot read property 'timing'的定义
- 未捕获的TypeError: Cannot read property 'checked'零
- 未捕获的TypeError: Cannot read property 'top'在引导中单击导航栏时未
- Extjs5 treepanel [Uncaught TypeError: Cannot read property &
- TypeError: Cannot read property 'submit'添加到购物车'
- 添加自定义jquery.验证方法导致Uncaught TypeError: Cannot read property &
- Vue 2和Vue- resource [Cannot read property 'get'未定义的(
- asp:textbox Uncaught TypeError: Cannot read property 'va
- TypeError: Cannot read property 'search' of undefine
- 读取json时出错未捕获类型错误:Cannot read property 'output'的定义
- 未捕获的TypeError: Cannot read property 'current'在选择任何选项
- 未捕获的TypeError: Cannot read property '3'的定义
- jquery-ui.js:12443未捕获的TypeError: Cannot read property 'a
- jquery Uncaught TypeError: Cannot read property 'left
- 在自定义指令中出现错误"Cannot set property 'null"