example for pagination

test it here:
http://plnkr.co/edit/Wtkv71LIqUR4OhzhgpqL?p=preview