title: How do I switch div layers with a timeout function in Angularjs?
body: <p>members of the Angular Technorati. I come to you with a puzzling issue, although simple. I need to switch out a div layer after about 11 seconds and show another div layer. How is this done using angularjs timeout service, preferably within a controller?</p>
  
  <p>Ok, what if I combined a show and hide event with the $timeou service?</p>
  
  <pre><code>`  &lt;body ng-app="myApp"&gt;
  &lt;div ng-controller="showHideController"  ng-init="getPanel_1()"&gt;
  
  
  
  
    &lt;div  ng-controller="showHideController" ng-show="divA"style=''&gt;
  
  
  &lt;/div&gt;
  
  
  
  &lt;div ng-controller="showHideController" ng-show="divB" style=''&gt;
  &lt;/div&gt;
  &lt;script&gt;
   angular.module('myApp',[]).controller('showHideController',function($scope, $timeout) {
  
  
    $scope.getPanel_1 = function(){
    $scope.divA = true;
    $scope.divB = false;
    $scope.divC = false; 
    }
    $timeout(function (){
    $scope.getPanel_1 = function(){
    $scope.divA = false;
    $scope.divB = true;
    $scope.divC = false; 
    }
    }, 5000);
  });
  
  &lt;/script&gt;`
  </code></pre>
  
  <p>Thanks in advance,
  Batoe.</p>
  
  <p>"The road to success is filled with obstacles......but also success!"
  The unknown optimist.</p>