pagination extracted in directive