Thursday, January 18, 2018

Switching Div every 3 min with Angular JS

<!DOCTYPE html>
<html>
<script
<body>

       <div ng-app="myApp" ng-controller="myCtrl">

              <button ng-click="myFunc()">Click Me!</button>
              <h1>{{theTime}}</h1>
              <div ng-show="showMe">errors (e.g., a thermometer reading from
                     an outdoor Arctic location recording a tropical temperature). Data
                     processing commonly occurs by stages, and the "processed data" from
                     one stage may be considered the "raw data" of the next stage. Field
                     data is raw data that is collected in an uncontrolled "in situ"
                     environment. Experimental data is data that is generated within the
                     context of a scientific investigation by observation and recording.</div>
              <div ng-show="hideMe">
              <table >
    <thead>
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>John</td>
        <td>Doe</td>
        <td>john@example.com</td>
      </tr>
      <tr>
        <td>Mary</td>
        <td>Moe</td>
        <td>mary@example.com</td>
      </tr>
      <tr>
        <td>July</td>
        <td>Dooley</td>
        <td>july@example.com</td>
      </tr>
    </tbody>
  </table>
                    
                     </div>
                    
                    

       </div>

       <script>
              var app = angular.module('myApp', []);
              app.controller('myCtrl', function($scope, $interval) {
                     $scope.showMe = true;
                     $scope.hideMe = false;

                     $scope.theTime = new Date().toLocaleTimeString();
                     $interval(function() {
                           $scope.theTime = new Date().toLocaleTimeString();
                           $scope.showMe = !$scope.showMe;
                           $scope.hideMe = !$scope.hideMe;
                     }, 3000);
              });
       </script>

       <p>Click the button to show/hide the menu.</p>

</body>
</html>


No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...