angularjs-$interval 服务
2017-02-06 15:40
483 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<h3>`theTime `</h3>
</div>
</body>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope,$interval){
$scope.theTime = new Date().toLocaleTimeString();
$interval(function(){
$scope.theTime = new Date().toLocaleTimeString();
},1000);
});
</script>
</html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<h3>`theTime `</h3>
</div>
</body>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope,$interval){
$scope.theTime = new Date().toLocaleTimeString();
$interval(function(){
$scope.theTime = new Date().toLocaleTimeString();
},1000);
});
</script>
</html>
相关文章推荐
- 如何在 Ubuntu 和其他 Linux 发行版中启动、停止和重启服务
- Angularjs 跨域请求
- linux
- 搭建常用服务pure-ftpd服务
- 安全帐户管理器初始化失败:目录服务无法启动,错误状态 0xc00002e1 lsass.exe
- 将批处理文件注册成服务在系统启动的时候自动调用
- 全球路由DNS服务器
- 用sc删除mysql服务技巧
- Powershell获取系统中所有可停止的服务
- 在同一台机器上运行多个 MySQL 服务
- SQL Sever2008r2 数据库服务各种无法启动问题的解决办法(详解)
- C语言实现在windows服务中新建进程的方法
- MySql 5.7.14 服务没有报告任何错误的解决方法(推荐)
- AngularJS中run方法的巧妙运用
- AngularJS 指令详细介绍
- Angular的$http的ajax的请求操作(推荐)
- AngularJS基础 ng-model 指令详解及示例代码
- AngularJs $parse、$eval和$observe、$watch详解
- AngularJS API之copy深拷贝详解及实例
- AngularJS基础教程之简单介绍