显示当前时间
- <script id="others_angular_103" type="text/javascript" class="library" src="/js/sandbox/other/angular.min.js"></script>
当前时间:{{colok.now}};
- function colokcontroller($scope) {
- var updatecolok = function() {
- $scope.colok = {
- now: new Date()
- };
- var updataColok = function() {
- $scope.colok.now = new Date();
- }
- setInterval(function() {
- $scope.$apply(updataColok);
- },
- 1000);
- };
- updatecolok();
- }
来源: http://www.2cto.com/kf/201702/600268.html