I am using ng-repeat and have a array of object.
So according to one of the parameter I want to resize image.
Duration contains time in milliseconds. I want to change it in minutes and set it as pixel
style="width:{{albumItem.duration}}
I am using ng-repeat and have a array of object.
So according to one of the parameter I want to resize image.
Duration contains time in milliseconds. I want to change it in minutes and set it as pixel
style="width:{{albumItem.duration}}
Try below code:-
ng-style="{{setWidth(albumItem.duration)}}"
Controller:-
$scope.setWidth=function(millis){
var minutes = Math.floor(millis / 60000);
return{
"width":minutes+"px"
}
}
Plunker Hope it help :)