angular - TypeError:_this._driver.validateStyleProperty 不是函数 TypeError:_this._driver.validateStyleProperty 不是函数
问题描述
在这里我尝试向元素添加淡入淡出动画
home.component.html 的。但是发生了错误。这是在 Angular 6 上完成的。提前致谢。
在 home.component.ts 中添加动画 :[....] 部分后发生错误
//app.module.ts
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
]
//home.component.ts
@Component({
selector: 'dhz-home',
templateUrl: './home.component.html',
styleUrls: ['home.scss'],
animations: [
trigger( 'fadeInOnLoad', [
state('unloaded', style({
transform: 'translateY(-200px)',
visibility: 'hidden',
transition: '.5s transform .2s visibility',
})),
state('loaded', style({
visibility: 'visible',
transform: 'translateY(0)'
})),
transition('unloaded => loaded',[
animate('2s')
]),
])
]
})
//home.component.html
<p [@fadeInOnLoad]="isLoaded ? loaded : unloaded" >Fade Up</p>
解决方案
推荐阅读
- c++ - C++ --- getline 和 cin ignore () . 删除输出字符串中的第一个字符
- ms-access - 如何让我的访问表单重新打开到最后一个未绑定的文本框条目?
- ruby-on-rails-4 - 在视图中呈现关联的 ActiveRecord 属性
- linker - SEGMENT_START("text-segment", 0x400000) 代表什么?
- flutter - 如何在颤动中实现自定义旋转容器/小部件?
- scala - 目录上的 FileWatcher
- c++ - 插入功能不会添加新元素
- c# - C# linq 查询聚合可为空的布尔值
- excel - 如何在更改单元格颜色或以特定间隔自动计算工作表?
- excel - How do I sum a variable range?