The relevant repository can be found here mi-angular-alert-service
Alert Service for AngularJS.
A customizable alert service for AngularJS apps.
Install with npm
$ npm i mi-angular-alert-service --save
Attention, the integration of bootstrap is required for the example ...
# app.js
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>
Trigger unit test with npm
$ npm run test
Every push will trigger a test run at travis-ci (node.js-versions: 0.10, 0.12, 4.0, 4.1, 4.2 and 4.3). In case of a tagged version and success (node.js 4.3) an automated pbulish to npmjs.org will be triggered by travis-ci.
- 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
This library is under the MIT license.