<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="angular-1.3.0.js"></script>
<title></title>
</head>
<body ng-app="myApp">
<div ng-controller="myCtrl">
<div>{{ nowtime }}</div>
<div>等待5秒显示的文字:{{ mytext }}</div>
</div>
<script>
var nowtime = function () {
return new Date().toLocaleDateString() + " " + new Date().toLocaleTimeString();
};
var app = angular.module("myApp", []);
app.controller("myCtrl", function ($scope, $interval, $timeout) {
$interval(function () {
$scope.nowtime = nowtime();
}, 1000);
$timeout(function () {
$scope.mytext = "Java B C";
}, 5000);
});
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="angular-1.3.0.js"></script>
<title></title>
</head>
<body ng-app="myApp">
<div ng-controller="myCtrl">
<div>{{ nowtime }}</div>
<div>等待5秒显示的文字:{{ mytext }}</div>
</div>
<script>
var nowtime = function () {
return new Date().toLocaleDateString() + " " + new Date().toLocaleTimeString();
};
var app = angular.module("myApp", []);
app.controller("myCtrl", function ($scope, $interval, $timeout) {
$interval(function () {
$scope.nowtime = nowtime();
}, 1000);
$timeout(function () {
$scope.mytext = "Java B C";
}, 5000);
});
</script>
</body>
</html>