Angular module that adds "growl-like" message functionality.
- AngularJS 1.3
Declare the Growl Messages module in the app module.
angular.module('app', ['growl'])
This module comes with a service that handles adding and removing messages.
app.controller('SomeController', ['$scope', 'GrowlMessages',
function( $scope, GrowlMessages ) {
GrowlMessages.notice("This is a notice styled message");
GrowlMessages.success("This is a success styled message");
GrowlMessages.error("This is a error styled message");
GrowlMessages.add("Custom style", 'custom-class');
}]);
Add the growl messages directive anywhere in the app. The given directives are a container for the messages that can be styled.
<div growl-messages></div>
Example of compiled directive templates:
<div class="growl-messages">
<div class="growl-message success">
<span>Growl message</span>
<button>×</button>
</div>
</div>
Testing the test app.
npm install -g http-server
cd path/to/growl/testapp
http-server