728x90
    
    
  반응형
    
    
    
  개요
재시작 버튼을 눌렀을 때 일정 시간동안 block 상태를 만들고
이후 다시 실행될 수 있게끔 해야 한다.
해결
- $timeout 함수 사용
ct.instanceRestart = function (guid, index) {
    ct.isRestart = true;
    var appPromise = applicationService.restartAppInstance(guid, index);
        $timeout(function() {
            ct.isRestart = false;
        }, 5000);
- html 에서는 ng-disabled 사용
<button type="button" name="button" ng-disabled="contents.isRestart" ng-click="contents.instanceRestart(contents.app.guid, statItem.id);"><span class="ico">재시작</span></button>화면
실행 후

5초 뒤

Reference
728x90
    
    
  반응형
    
    
    
  '프로그래밍 > AngularJs' 카테고리의 다른 글
| [AngularJs] - angularJS 이중 배열 for문으로 접근하기(html) (0) | 2021.01.13 | 
|---|---|
| [AngularJs] - 반복문으로 이중배열 데이터를 빈 배열에 추가 (0) | 2021.01.13 | 
| [AngularJs] - ng:cpws Can't copy! Making copies of Window or Scope instances is not supported (0) | 2021.01.13 | 
| [AngularJs] - toFixed (0) | 2021.01.11 | 
| [AngularJs] - ng-repeat으로 이중 배열 접근 (0) | 2021.01.11 |