2016-08-22 3 views
0

각도 재료 탭 사용. 문제는 탭이 같은 크기가 아니라는 것입니다. 내용에 따라 달라집니다. 그래서 내면을 ng-scope의 크기로 만들 수 있는지 궁금합니다. ng-scope.내부 div 스타일 사용 방법

이 결과 md-tab-content

<md-tab-content id="tab-content-3" class="_md ng-scope md-active"> 
    <div class="ng-scope ng-isolate-scope"> 
    </div> 
</md-tab-content> 

것은의 단순화 버전은 내가 각 요소를 참조 할 수있다인가? outter는 md-tab-content 252

enter image description here

탭 코드입니다 때 내부 div 높이가 57 여기

md-tab-content > div.ng-scope { 
    and set size here = outside size? 

    //worst case set the height by hand 
    height: 252px; 
} 

처럼 뭔가를 할

<div id="tree-footer-container" ng-cloak> 
    <md-tabs id="jc" md-selected="selectedIndex"> 
     <md-tab class="fullSize" ng-repeat="tab in tabs" ng-disabled="tab.disabled"> 
      <md-tab-label> 
        <div style="float: left;padding-right: 10px;">{{tab.title}}</div> 
      </md-tab-label> 
      <md-tab-body> 
       <div flex style="background:blue" class="demo-tab tab{{$index%4}}" ng-include="tab.url"> 
       </div> 
      </md-tab-body> 
     </md-tab> 
    </md-tabs> 
</div> 

답변

0

재료 레이아웃 지시어를 사용해보십시오 :

(210)
<md-tab-content id="..." layout="column" class="..."> 
    <div flex class="..."> 
    </div> 
</md-tab-content> 
+0

은 자동 생성됩니다. 나는 그 중 어떤 것도 만들지 못했지만 당신의 대답은 여전히 ​​관련이 있습니까? 더 자세한 정보가 필요 하니까요. –

+0

수도 있습니다. 시도 해봐. – Malk

+0

어떻게? 다시 자동 생성됩니다. 나는 생성 된 요소를 변경하기 위해 CSS를 만들려고 시도 할 수 있습니다. –

0

나는 모든 수업의 모르겠지만 난이 jQuery를 함께 해결하는 것입니다 생각 :

var newWidth = $('.ng-isolate-scope').outerWidth; 
$('.classOfOtherDiv').width(newWidth); 

먼저 당신은 하나의 DIV의 외부 폭이 다음 다른에 적용 얻을. 그 일 했니?

+0

일할 수는 있지만 상황이 바뀌면 코드를 어디에 넣어야합니까? 그래서 CSS에 대해 생각하고있는 것입니다. –

+0

함수는 resize/load/ready에 함수를 호출한다 : 크기 변경 : '$ (window) .resize (function() {resizeWidthFuntion()}); ' –

+0

당신이 이것을 해결 했음에 틀림 없다. 대답은 –