The selected pages are retrieved when the directive is loaded