I have a bar graph in Jquery that I want to recreate in angular. The graph is just stylized divs thats width are set to a percentage of the parent as shown below
$('.item-skills').each(function(){
newWidth = $(this).parent().width() * $(this).data('percent');
$(this).width(newWidth);
});
I want to put this in a directive called bar-graph
to use like
<div bar-graph="0.85"></div>
Which would produce a div thats width is 85% of the parents
Edit: I found a solution here Angularjs adjust width based on parent element width