angularjs - Calculation on binding in angular -
i using ng-repeat , have array of object.
so according 1 of parameter want resize image.
duration contains time in milliseconds. want change in minutes , set 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 :)
Comments
Post a Comment