Last active
August 29, 2015 14:26
-
-
Save justinwinslow/643f5f7fa5223efb3786 to your computer and use it in GitHub Desktop.
Simple ng-repeat rendering timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('someModule', []) | |
.directive('ngRepeatTimer', function() { | |
var start; | |
return function(scope) { | |
if (scope.$first) { | |
start = new Date().getTime(); | |
} | |
if (scope.$last){ | |
console.log('ng-repeat rendering time:', new Date().getTime() - start); | |
} | |
}; | |
}); | |
// <li ng-repeat="thing in things" ng-repeat-timer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment