Fix issue when compiling with Google Closure compiler

When compiling ng-table with Google's closure compiler, the code would not paginate. The `while` loop below the declaration of `i` was converted to a `for` loop. After declaring `i` as variable and recompiling, ng-table works as expected.