File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ angular
4+ . module ( 'animationBenchmark' , [ 'ngAnimate' ] , config )
5+ . controller ( 'BenchmarkController' , BenchmarkController ) ;
6+
7+ // Functions - Definitions
8+ function config ( $compileProvider ) {
9+ $compileProvider
10+ . commentDirectivesEnabled ( false )
11+ . cssClassDirectivesEnabled ( false )
12+ . debugInfoEnabled ( false ) ;
13+ }
14+
15+ function BenchmarkController ( $scope ) {
16+ var self = this ;
17+ var itemCount = 1000 ;
18+ var items = ( new Array ( itemCount + 1 ) ) . join ( '.' ) . split ( '' ) ;
19+
20+ benchmarkSteps . push ( {
21+ name : 'create' ,
22+ fn : function ( ) {
23+ $scope . $apply ( function ( ) {
24+ self . items = items ;
25+ } ) ;
26+ }
27+ } ) ;
28+
29+ benchmarkSteps . push ( {
30+ name : '$digest' ,
31+ fn : function ( ) {
32+ $scope . $root . $digest ( ) ;
33+ }
34+ } ) ;
35+
36+ benchmarkSteps . push ( {
37+ name : 'destroy' ,
38+ fn : function ( ) {
39+ $scope . $apply ( function ( ) {
40+ self . items = [ ] ;
41+ } ) ;
42+ }
43+ } ) ;
44+ }
Original file line number Diff line number Diff line change 1+ /* eslint-env node */
2+
3+ 'use strict' ;
4+
5+ module . exports = function ( config ) {
6+ config . set ( {
7+ scripts : [
8+ {
9+ id : 'jquery' ,
10+ src : 'jquery-noop.js'
11+ } , {
12+ id : 'angular' ,
13+ src : '/build/angular.js'
14+ } , {
15+ id : 'angular-animate' ,
16+ src : '/build/angular-animate.js'
17+ } , {
18+ src : 'app.js'
19+ }
20+ ]
21+ } ) ;
22+ } ;
Original file line number Diff line number Diff line change 1+ // Override me with ?jquery=/bower_components/jquery/dist/jquery.js
Original file line number Diff line number Diff line change 1+ < style >
2+ [ng-cloak ] { display : none !important ; }
3+ .animation-container .ng-enter ,
4+ .animation-container .ng-leave {
5+ transition : all 0.1s ;
6+ }
7+
8+ .animation-container .ng-enter ,
9+ .animation-container .ng-leave .ng-leave-active {
10+ opacity : 0 ;
11+ }
12+
13+ .animation-container .ng-enter .ng-enter-active ,
14+ .animation-container .ng-leave {
15+ opacity : 1 ;
16+ }
17+ </ style >
18+ < div ng-app ="animationBenchmark " ng-cloak ng-controller ="BenchmarkController as bm ">
19+ < div class ="container-fluid ">
20+ < h2 > Large collection of elements animated in and out with ngAnimate</ h2 >
21+
22+ < div class ="animation-container ">
23+ < div ng-repeat ="i in bm.items track by $index ">
24+ Just a plain ol' element
25+ </ div >
26+ </ div >
27+ </ div >
28+ </ div >
You can’t perform that action at this time.
0 commit comments