Adds directive attribute for closing previously opened dialogs