Adding vs-repeat performance test sample.

This commit is contained in:
Gunther Brunner
2014-06-10 16:07:08 +09:00
parent f06035b8ac
commit bb70b0386d
7 changed files with 413 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
module.exports = function ($scope) {
function getArray(size) {
var arr = [];
for (var i = 0; i < size; i++) {
arr.push({
a: '',
b: ''
})
}
return arr;
}
$scope.$watch('arraySize', function (s) {
$scope.bar = getArray(+s);
});
var interval = setInterval(function interval() {
var t1 = Date.now();
$scope.$digest();
$scope.digestDuration = (Date.now() - t1);
}, 1000);
$scope.$on('$destroy', function () {
clearInterval(interval);
});
}