• angularJs-clock


     1 <!DOCTYPE html>
     2 <html lang="en" ng-app="myClock">
     3 <head>
     4 <meta charset="UTF-8">
     5 <title>angularJs-clock</title>
     6 <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> 
     7 </head>
     8 <body>
     9 <div ng-app ng-controller="MyController">
    10 <h1>现在时间是:<span ng-bind="clock"></span></h1>    
    11 </div>
    12 </body>
    13 <script>
    14 angular.module('myClock',[])
    15 .controller('MyController', function($scope,$timeout){
    16 var updateClock = function(){
    17 $scope.clock = new Date();
    18 } 
    19 updateClock();
    20 }
    21 )
    22 </script>
    23 </html>
     1 <!DOCTYPE html>
     2 <html lang="en" ng-app="myClock">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>angularJs-clock</title>
     6     <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> 
     7 </head>
     8 <body>
     9     <div ng-app ng-controller="MyController">
    10         <h1>现在时间是:<span ng-bind="clock.fulldate"></span></h1>        
    11     </div>
    12 </body>
    13 <script>
    14     angular.module('myClock',[])
    15     .controller('MyController', function($scope){
    16         $scope.clock = {};
    17         var updateClock = function(){
    18             $scope.clock.now = new Date();
    19             $scope.clock.fulldate = new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate()+" "+new Date().getHours()+":"+new Date().getMinutes()+":"+new Date().getSeconds()
    20         }
    21         setInterval(function(){
    22             $scope.$apply(updateClock);
    23         },1000)
    24         updateClock();
    25     }
    26 )
    27 </script>
    28 </html>
    View Code
  • 相关阅读:
    使用doctest单元测试方式培训讲解:Python字符串格式化(适合测试工程师的学习方法)
    树莓派Raspberry中成功安装RobotFramework+Selenium
    树莓派Raspberry实践笔记-安装使用minicom
    树莓派Raspberry实践笔记-解决官方文档打开慢问题
    window电脑蓝屏
    fastjson基本用法
    自定义注解
    curl工具
    观察者模式
    工厂模式
  • 原文地址:https://www.cnblogs.com/johnhery/p/9787990.html
Copyright © 2020-2023  润新知