<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope,$timeout){
//获取当前系统的时间对象
$scope.name = "张三";
//设置定时器,每一秒调获得以下系统时间,复制给$scope.time
$timeout(function(){
$scope.name = "李四";
},3000);
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<p>{{name}}</p>
</body>
网友评论