Angular Alert Service

Alert Service for AngularJS.
A customizable alert service for AngularJS apps.
Installation
Install with npm
$ npm i mi-angular-alert-service --save
Usage
Attention, the integration of bootstrap is required for the example ...
require('angular-bootstrap');
require('mi-angular-alert-service');
var requires = [
'ui.bootstrap',
'mi.AlertService'
];
angular.module('sample-app', requires)
// defaults for alert service
.constant('ALERT_LEVELS', {
danger: {timeout: 10000},
warning: {timeout: 5000},
success: {timeout: 3000},
info: {timeout: 3000}
})
;
angular.bootstrap(document, ['sample-app']);
# index.html
<div class="global-alerts" ng-cloak>
<div alert ng-repeat="alert in alerts" type="{{alert.type}}" close="alert.close()">{{alert.msg}}</div>
</div>
Tests
Trigger unit test with npm
$ npm run test
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
This library is under the MIT license.