Make pagination AngularJS 1.3 compatible

The pagination does not work in angular 1.3 because pages is not passthru to the scope of the template.

This will work with angular 1.2.x and 1.3.