title: Adding auto refresh after a particular interval (5 seconds) in angular js
body: <p>I have a page in which which has multiple tabs. I want to add the feature that the tab is reloaded automatically after a fixed duration. I have the following: </p>
  
  <pre><code>&lt;uib-tab index="$index + 1" ng-repeat="environmentRegionTab in ctrl.environmentRegionTabs"
           heading="{{environmentRegionTab.environmentRegionName}}"
           select="ctrl.onEnvironmentRegionSelect(environmentRegionTab.id);"&gt;
      &lt;div class="panel-body tab-content"&gt;
          &lt;div class="alert alert-success" ng-show="ctrl.deployStatus[ctrl.environmentRegion.name].show"&gt;
              &lt;strong&gt;Launched deployment with execution id
                  {{ctrl.deployStatus[ctrl.environmentRegion.name].id}}&lt;/strong&gt;
          &lt;/div&gt;
  
  ...................
  </code></pre>
  
  <p>And the following controller: </p>
  
  <pre><code>export function ServiceDetailController(ecsServiceResponse, teamListResponse, productListResponse, businessSubOwnerListResponse, serviceInstancesResponse, businessOwnerListResponse, EcsService, SecretsService, $location, $stateParams, $uibModal, $scope, $state, $window) {
      'ngInject';
      var self = this;
      var serviceInstanceId;
  self.ecsAuthControl = {};
  self.initialize = _initialize;
  self.clearMessages = _clearMessages();
  self.onEnvironmentRegionSelect = _onEnvironmentRegionSelect;
  
  $scope.reloadRoute = function() {
      $state.reload();
  };
  
  function _onEnvironmentRegionSelect(serviceInstanceId) {
      self.selectedserviceInstanceId = serviceInstanceId;
      if (serviceInstanceId) {
          $location.search('serviceInstanceId', serviceInstanceId);
          _loadEnvironmentRegion();
      } else {
          $location.search('serviceInstanceId', null);
          _loadSummary();
      }
  }
  
  }
  </code></pre>
  
  <p>I am not able to understand how to add the fixed time duration? I also would like to show a counter ticking down from 5 to 0 after which the page is reloaded. How can I do it? I declared the reload function but I am not able to figure out how to add a fixed timer? Thanks! </p>