You can also specify handlers you wish to run when the notification opens and closes: You will need to close the notification manually using $growlNotification.remove(). You can use the native AngularJS ng-if directive to make this happen: īy default notifications are shown for 5 seconds, but you can specify the ttl in milliseconds for every notification individually: Ī ttl of -1 or false will disable the automatic closing timeout, making the notification permanent. Most of the time you will want to show a notification when some event occurs. You can now use the growl-notification (singular) directive to create notifications anywhere in your application: In most cases you should simply add it as the first element inside the body element: Ĭheck out the growl-notifications directive documentation for more information. This directive allows you to control where the notifications are rendered in your DOM in case your application requires special behavior. STEP 2: Specify where you want to render the notificationsīefore you can create notifications, you need to add the growl-notifications (plural) directive to your markup. The library is now loaded in your AngularJS application. Load the growlNotifications module in your AngularJS application: angular.module('yourApp', ) Most existing growl systems require you to add notifications using JavaScript inside your controller layer. Notifications logically belong inside the view layer of your application.