Added Alert trigger logic
Refactored alert directive to have controller"