<body> <div ng-app="myApp" ng-controller="myCtrl" class="ng-cloak"> 当前时间:{{clock | date:'yyyy-MM-dd HH:mm:ss'}} </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.clock = new Date(); var updateClock = function() { $scope.clock = new Date(); }; setInterval(function() { $scope.$apply(updateClock); }, 1000); updateClock(); }); </script> </body>