angularjs依赖注入,setInterval()功能

var app=angular.module('myApp',[]);

app.controller('CurTimeController', function($scope,$interval) {

$interval(function() {

        $scope.x = new Date().getSeconds();

    }, 1000);

})  

原文地址:https://www.cnblogs.com/yuan2013/p/6592864.html