각도로 다시 만들고 싶은 Jquery의 막대 그래프가 있습니다.div의 너비를 angular.js에서 parent의 백분율로 설정합니다.
$('.item-skills').each(function(){
newWidth = $(this).parent().width() * $(this).data('percent');
$(this).width(newWidth);
});
아래와 같이 그래프가 바로 스타일 화 된 div 이잖아 폭은 내가 생산 것이다
<div bar-graph="0.85"></div>
처럼 사용하는 bar-graph
라는 지시에 넣고 싶은 부모의 비율로 설정되어있다 DIV 그게 전부 폭은 부모의 85 %
편집이다 : 나는 당신이 후입니다 것은 광고 여기 Angularjs adjust width based on parent element width
을 도움이되지만 경우 아래에있는 내 솔루션입니다에서 creating directives에 대한 링크입니다 – Pete