angularjs依赖注入,setInterval()功能

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

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

$interval(function() {

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

    }, 1000);

})  

posted @ 2017-03-21 09:45  知不知道  阅读(1232)  评论(0编辑  收藏  举报