File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 6868 // Now that we have access to the `scope` we can interpolate any expression given in the paginationId attribute and
6969 // potentially register a new ID if it evaluates to a different value than the rawId.
7070 var paginationId = $parse ( attrs . paginationId ) ( scope ) || attrs . paginationId || DEFAULT_ID ;
71+
72+ // (TODO: this seems sound, but I'm reverting as many bug reports followed it's introduction in 0.11.0.
73+ // Needs more investigation.)
7174 // In case rawId != paginationId we deregister using rawId for the sake of general cleanliness
7275 // before registering using paginationId
73- paginationService . deregisterInstance ( rawId ) ;
76+ // paginationService.deregisterInstance(rawId);
7477 paginationService . registerInstance ( paginationId ) ;
7578
7679 var repeatExpression = getRepeatExpression ( expression , paginationId ) ;
105108
106109 // Delegate to the link function returned by the new compilation of the ng-repeat
107110 compiled ( scope ) ;
108-
111+
112+ // (TODO: Reverting this due to many bug reports in v 0.11.0. Needs investigation as the
113+ // principle is sound)
109114 // When the scope is destroyed, we make sure to remove the reference to it in paginationService
110115 // so that it can be properly garbage collected
111- scope . $on ( '$destroy' , function destroyDirPagination ( ) {
112- paginationService . deregisterInstance ( paginationId ) ;
113- } ) ;
116+ // scope.$on('$destroy', function destroyDirPagination() {
117+ // paginationService.deregisterInstance(paginationId);
118+ // });
114119 } ;
115120 }
116121
Original file line number Diff line number Diff line change @@ -1133,7 +1133,7 @@ describe('dirPagination directive', function() {
11331133 compile ( ) ;
11341134
11351135 var $list1 = containingElement . find ( 'ul.list' ) . eq ( 0 ) ;
1136- var $list2 = containingElement . find ( 'ul.list' ) . eq ( 1 ) ;
1136+ var $list2 = containingElement . find ( 'ul.list' ) . eq ( 1 ) ;
11371137
11381138 expect ( getListItems ( $list1 ) ) . toEqual ( [ '1' , '2' , '3' ] ) ;
11391139 expect ( getListItems ( $list2 ) ) . toEqual ( [ 'a' , 'b' , 'c' ] ) ;
You can’t perform that action at this time.
0 commit comments