Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagor87 committed Oct 12, 2015
2 parents ce65ad5 + d1fec71 commit 4444841
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 6 deletions.
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,53 @@
[![Build Status](https://secure.travis-ci.org/N4Works/n4notifications.png?branch=master)](https://travis-ci.org/N4Works/n4notifications)
[![Coverage Status](https://coveralls.io/repos/N4Works/n4notifications/badge.svg?branch=master&service=github)](https://coveralls.io/r/N4Works/n4notifications/?branch=master)

# about
## about

> n4Notifications: best AngularJS module ever!
A simple module to notifies user with messages.

#LICENSE
## how to install

```
bower install n4-notifications-directive --save
```

## how to use

Add the directive element in your HTML body

```
<n4-notifications></n4-notifications>
```

Remember to inject the dependency in your module.

```
angular.module('yourModule', ['n4Notifications']);
```

In your controller, you just need to use a service.

```
angular.module('sample', ['ngAnimate','n4Notifications'])
.controller('rootController', function (n4NotificationsService) {
this.notify = function () {
n4NotificationsService.notifyInformation('Test', 'Ok');
n4NotificationsService.notifyAlert('Test', 'Ok');
n4NotificationsService.notifySuccess('Test', 'Ok', 'Undo', function (selector) {
console.log(selector + ' -> callback');
}).then(function (selector) {
console.log(selector + ' -> promise');
});
}
});
```

- *notifySuccess:* first parameter is the message, second is the text for primary button, third, text for secondary button, callback method, where the argument is the text of the chosen button.
- *notifyAlert:* first parameter is the message, second is the text for primary button, third, text for secondary button, callback method, where the argument is the text of the chosen button.
- *notifyInformation:* first parameter is the message, second is the text for the button, and third is the callback method.
- Every method returns a promise, so, you don't have to use the callback method.
- Messages with one option, would be visible just for 15 seconds.

##LICENSE

MIT
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dist/n4notifications.js",
"dist/n4notifications.css"
],
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com//n4Notifications",
"authors": [
"N4Works <contato@n4works.com>"
Expand Down
5 changes: 5 additions & 0 deletions dist/n4notifications.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
transition: all ease .4s;
}

/* Fix for Bootstrap */
.notifications *, .notifications *:before, .notifications *:after {
box-sizing: content-box;
}

.notification.ng-enter,
.notification.ng-leave.ng-leave-active{
opacity:0;
Expand Down
2 changes: 1 addition & 1 deletion dist/n4notifications.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n4Notifications",
"version": "0.0.1",
"version": "0.0.2",
"main": [
"dist/n4notifications.js",
"dist/n4notifications.css"
Expand Down
5 changes: 5 additions & 0 deletions src/n4notifications.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
transition: all ease .4s;
}

/* Fix for Bootstrap */
.notifications *, .notifications *:before, .notifications *:after {
box-sizing: content-box;
}

.notification.ng-enter,
.notification.ng-leave.ng-leave-active{
opacity:0;
Expand Down

0 comments on commit 4444841

Please sign in to comment.