function makeCurrentPageGetterFn(scope, attrs, paginationId) {
            var currentPageGetter;
            if (attrs.currentPage) {
                currentPageGetter = $parse(attrs.currentPage);
            } else {
                // If the current-page attribute was not set, we'll make our own.
                // Replace any non-alphanumeric characters which might confuse
                // the $parse service and give unexpected results.
                // See https://github.com/michaelbromley/angularUtils/issues/233
                // Adding the '_' as a prefix resolves an issue where paginationId might be have a digit as its first char
                // See https://github.com/michaelbromley/angularUtils/issues/400
                var defaultCurrentPage = '_' + (paginationId + '__currentPage').replace(/\W/g, '_');
                scope[defaultCurrentPage] = 1;
                currentPageGetter = $parse(defaultCurrentPage);
            }
            return currentPageGetter;
        }
Creates a getter function for the current-page attribute, using the expression provided or a default value if
no current-page expression was specified.

@param scope
@param attrs
@param paginationId
@returns {*}