I'm using an ng repeat directive to dynamically set the height in my code.
<ul>
<li ng-repeat="val in values" height-dir >{{val.a}}</li>
</ul>
app.directive('heightDir',function(){
return {
restrict: 'AE',
replace: true,
template: '<li ng-repeat="val in values" style="height:{{val.b}}%" >{{val.a}}</li>',
link: function(scope, elem, attrs) {
}
};
});
$scope.values= [{a:"Doe",b:10},{a:"bom",b:20},{a:"kal",b:30},{a:"jijo",b:40}];
Upon running the code, I noticed a gap between the value and % where the style was not applied. Can anyone suggest a solution to this issue? Any help is appreciated. Thank you.