/
githubmirror
/
angular.js
Обзор
Документация
Войти
/
githubmirror
/
angular.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
benchmarks/animation-bp/app.js
44 строки
879 B
Georgios Kalpakas
chore(benchmarks): add basic animation benchmark
25 янв 2017, 00:54
25 янв 2017, 00:54
565ca6a
Код
Авторство
О чём код?
'use strict'; angular .module('animationBenchmark', ['ngAnimate'], config) .controller('BenchmarkController', BenchmarkController); // Functions - Definitions function config($compileProvider) { $compileProvider .commentDirectivesEnabled(false) .cssClassDirectivesEnabled(false) .debugInfoEnabled(false); } function BenchmarkController($scope) { var self = this; var itemCount = 1000; var items = (new Array(itemCount + 1)).join('.').split(''); benchmarkSteps.push({ name: 'create', fn: function() { $scope.$apply(function() { self.items = items; }); } }); benchmarkSteps.push({ name: '$digest', fn: function() { $scope.$root.$digest(); } }); benchmarkSteps.push({ name: 'destroy', fn: function() { $scope.$apply(function() { self.items = []; }); } }); }