File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,36 @@ describe('dirPagination directive', function() {
274274 expect ( $scope . alias2 . length ) . toEqual ( 10 ) ;
275275 } ) ;
276276
277+ it ( 'should allow dot and bracket notation' , function ( ) {
278+ function compile ( ) {
279+ $scope . foo = {
280+ name : 'myCollection' ,
281+ myCollection : myCollection ,
282+ perPage : 10
283+ } ;
284+ compileElement ( myCollection , 5 , 1 , "item in foo[foo.name] | itemsPerPage:foo.perPage" ) ;
285+ }
286+ expect ( compile ) . not . toThrow ( ) ;
287+ expect ( getListItems ( ) . length ) . toEqual ( 10 ) ;
288+ } ) ;
289+
290+
291+ it ( 'should allow track by syntax 1' , function ( ) {
292+ function compile ( ) {
293+ compileElement ( myCollection , 5 , 1 , "item in collection | itemsPerPage: 10 track by $index" ) ;
294+ }
295+ expect ( compile ) . not . toThrow ( ) ;
296+ expect ( getListItems ( ) . length ) . toEqual ( 10 ) ;
297+ } ) ;
298+
299+ it ( 'should allow track by syntax 2' , function ( ) {
300+ function compile ( ) {
301+ compileElement ( myCollection , 5 , 1 , "item in collection | itemsPerPage: 10 track by item" ) ;
302+ }
303+ expect ( compile ) . not . toThrow ( ) ;
304+ expect ( getListItems ( ) . length ) . toEqual ( 10 ) ;
305+ } ) ;
306+
277307 } ) ;
278308
279309 describe ( 'if currentPage attribute is not set' , function ( ) {
You can’t perform that action at this time.
0 commit comments