ng-notifications-bar
Angular.js and Animate.css based component for stylish and flexible application notifications.
Overview
Web applications requires notify users of ongoing events. Common cases are errors, successful completion notifications etc. With ng-notifications-bar
it's as easy as,
...
Installation
Npm installation,
$ npm install ng-notifications-bar --save
Or bower installation,
$ bower install ng-notifications-bar --save
Update your scripts and styles section or use the require for browserified applications.
If you use Grunt, wiredep
should inject the required angular-sanitize.js
for you.
For browserify
applications, require module in yours application module,
;
In case you are using sass
in project, it's possible to just import ngNotificationsBar
styles,
;
In application module,
angular;
ngSanitize
can be omitted if HTML support isn't needed.
API
The module consists of there elements - directive, service and provider.
Directive
notifications-bar
element directive, should be placed once, typically right after <body>
open tag.
If you are using a icon library besides Glyphicons for the close button (such as Font Awesome), include a closeIcon
attribute.
The default is the glyphicon-remove
icon so don't forget to import Glyphicons if you aren't defining a closeIcon
attribute.
Possible to use as attribute, as well
Service
notification
service is used by controllers (or other directives), to show notifications.
appcontrollers'app' { api ; $scope { api ; }};
Provider
notificationsConfigProvider
is used to override some notifications bar defaults.
app
Settings
It is possible to setup the whole notifications bar module in module config and each notification separately in controller
Available options:
- autoHide
- hideDelay
- acceptHTML
- autoHideAnimation
- autoHideAniationDelay
Please note, HTML support is only configurable at a global level. If HTML is to be supported, make sure to inject the 'ngSanitize'
dependency.
var app = angular;
During configuration
app
Override in controller
app;
Development
Install bower
dependencies,
$ bower install
Install npm
dependencies,
$ npm install
Run grunt
build,
$ grunt
as result, /dist
folder is created with ready to use .js
and .css
file.
Project doesn't have tests at the moment, so run example
and check the functionality,
$ grunt start:example
Licence
Copyright (c) 2014, alexander.beletsky@gmail.com
MIT