Convert alerts to directive