SOURCE

console 命令行工具 X clear

                    
>
console
var myApp = angular.module('spicyApp1', []);

myApp.controller('TestController', ['$scope', function($scope) {
    $scope.spice = 'very';

    $scope.clickButton = _.throttle(function() {
        console.log(new Date());
    }, 1000,  {'trailing': false});


    // $scope.clickButton = function() {
    //     console.log(new Date());
    // };
}]);
<div ng-app="spicyApp1" ng-controller="TestController">
    双击测试按钮只会在控制台输出一个时间,间隔一秒后点击才会输出第二个<br>
    <button ng-click="clickButton()">测试</button>
</div>

本项目引用的自定义外部资源