wrap document if angular document is not available.