<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="angular-1.3.0.js"></script>
</head>
<body ng-app="myApp">
<div ng-controller="myCtrl">
<div>{{nowtime}}</div>
5秒之后出来:<img src="{{wenzi}}">
</div>
<script>
var app=angular.module("myApp",[]);
var nowtime = function () {
return new Date().toLocaleDateString() + " " + new Date().toLocaleTimeString();
};
app.controller("myCtrl",function($scope,$interval){
$interval(function(){
$scope.nowtime=nowtime();
},1000);
$interval(function(){
$scope.wenzi="dou.jpg";
},5000);
});
</script>
</body>
</html>
几秒出现数据(图片)和时间
最新推荐文章于 2021-06-04 02:13:51 发布