I have an animation that fills a table cell with a color. I want the animations keyframes to.width to be a variable that is controlled by an angular 2 component.
CSS:
#passing {
display: block;
height: 100%;
background-color: #81C784;
animation-duration: 2s;
animation-name: slideright;
}
@keyframes slideright {
from {
margin-right: 0%;
width: 0%;
}
to {
margin-right: 50%;
width: 50%;
}
}
HTML:
<div id="passing"
[style.width.%]="cells[id].width"
[style.keyframes.slideright.to.width.%]="cells[id].width">
</div>
The [style.width.%] works fine but I want to do something like the above to set the animation width dynamically for each cell but I am not sure how to access that attribute.