탭을 선택하고 2 개의 버튼을 표시하고 싶습니다.
은 그래서 이것은 내 영문 코드 :
<button id="UxMoveAllRight" style="width: 40px; height: 25px; margin-top: 20px;" ng-show="showMoveallButtons()">
<i class="pi-icon pi-icon-angle-double-right"></i>
</button>
<button id="UxMoveAllLeft" style="width: 40px; height: 25px; margin-bottom: 20px;" ng-show="showMoveallButtons()">
<i class="pi-icon pi-icon-angle-double-left"></i>
</button>
이것은 (controller.js에서) 내 NG 쇼 기능 코드 :
$scope.showMoveallButtons = function() {
var show = false;
$timeout(function() {
var activetab = $find("Add").get_selectedTab().get_name();
if (activetab == "AddBulk") { show = true }
else { show = false };
});
return show;
};
하지만 항상 false를 돌려줍니다. 선택 탭이 AddBulk와 같으면 2 버튼이 표시되지 않습니다.
항상 잘못된 이유를 반환합니다. timeout?
어떻게 해결할 수 있습니까?
ode'return show;는'return false;와 같습니다 ** 항상 ** – Tushar
무슨 뜻입니까? @tushar를 잘못하고있는 곳 – eagle
'ng-show'를 스코프 속성으로 지정하고 타임 아웃 내에서 변경하십시오. –