Paging controller for angular js