generating popups using directives