create a separated directive to handle the loading