<!DOCTYPE html>
<html ng-app="myApp" ng-controller="myCtrl">
<head lang="en">
<meta charset="UTF-8">
<title>T38-angular时间</title>
<script src="js/angular.js" type="text/javascript"></script>
</head>
<body>
<p>{{theTime}}</p>
</body>
<script type="text/javascript">
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>