我需要更新图像的变换旋转值,该值会随时间动态变化
我尝试了以下类似的方法,但是没有用style="transform: rotate(imagerotation ? imagerotation : 0 + deg);"
实现此目的的正确方法是什么?
最佳答案
试试这个:
[style.transform]="'rotate(' + (imagerotation ? imagerotation : 0) + 'deg)'"
关于angular2动态更改样式属性值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40066131/