Search code examples
javascriptangularjsintel-xdk

show and hide footer and footer message


I am trying to create an angular app using Intel XDK.Here when I run the index page we can see footer message. What I need is the footer and footer message will show and hide every 5 seconds

index.html

<div class="bar bar-footer bar-balanced" style="background-color:#444444;">
            <div class="title">{{footer_message}}</div>
</div>

Solution

  • You can use angular $interval or window.setInterval function

    $interval(function() {
    if($scope.showFooter)
    {
    $scope.showFooter =false;
    }
    else{$scope.showFooter =true;}
    },5000);
    

    Note: you have to inject $interval service in your controller

    in your html :

    <div ng-show="showFooter" class="bar bar-footer bar-balanced" style="background-color:#444444;">
                <div class="title">{{footer_message}}</div>
    </div>