Fix page switching

It seems like the ng-model directive on pagination doesn't work as it
should. So just rely on the location for page number instead.