jacqueslareau / angular-pnotify Goto Github PK
View Code? Open in Web Editor NEWAngularJS wrapper for PNotify
License: MIT License
AngularJS wrapper for PNotify
License: MIT License
Hi,
You define a dependency in your bower.json to bootstrap, but in a lots of case we don't use the official bootstrap package (for our case, we work with the SASS-Only or CSS-Only version)
Angular-Ui-Bootstrap require bootstrap CSS to be inserted, but they don't add this item to the dependency, letting us define the way we want to import bootstrap CSS.
Somethings could be done for that case ?
Thanks
Hello.
I know that this is only a wrapper for PNotify, but being built over AngularJS I thought it would be able to evalute angular $scope.
What I mean is: angular variables don't update inside the notification.
Isn't this service supposed to address this kind of thing?
Thanks in advance!
How can one install angular-pnotify using npm ?
Uncaught TypeError: Cannot read property 'prototype' of undefined
at pnotify.animate.js:1
at pnotify.animate.js:1
at pnotify.animate.js:1
"pnotify": "3.0.0" issue with this version, if i changed it to
"pnotify": "sciactive/pnotify#~2.0.1", I am not getting any error
Be clearer in the README that it's a simple wrapper and is intended to leverage PNotify's code.
You could add
removeNotifications: function() {
return PNotify.removeAll()
}
so it can be called by notificationService.removeNotifications().
At the moment, only way is window.PNotify.removeAll();
It's meant to act as a quick, easy and reusable way to use PNotify's library inside Angular.
Not really sure about creating a PNotify clone in Angular for now, but it will happen. It would require substantial time though.
Hi,
I think it would be great to return 'this' when we use the NotificationServiceProvider in order to chain the call :
notificationServiceProvider.setDefaults({
history: false,
delay: 5000,
closer: false,
closer_hover: false,
nonblock: { nonblock: false },
styling: "bootstrap3",
icon: true
});
notificationServiceProvider.setStack('bottom_right', 'stack-bottomright', {
dir1: 'up',
dir2: 'left',
});
notificationServiceProvider.setDefaultStack('bottom_right');
would be great like that :
notificationServiceProvider.setDefaults({
history: false,
delay: 5000,
closer: false,
closer_hover: false,
nonblock: { nonblock: false },
styling: "bootstrap3",
icon: true
}).setStack('bottom_right', 'stack-bottomright', {
dir1: 'up',
dir2: 'left',
}).setDefaultStack('bottom_right');
Othewise, thanks for your tiny library, very useful !
how can I show one notification at a time no matter what
yeah, tests.
I expected could be put in any page and then that could be triggered by $scope.
When angular-translate module is loaded, check if token exists and display the filtered result. Useful in controllers to skip loading $filter and also cleaner code
before:
notify.succes($filter('translate')('SAVED'));
after:
notify.success('SAVED');
Is there an API for supporting a custom HTML template definition?
Using "angular-pnotify": "~0.1.2"
'use strict';
angular.module('MyApp')
.config(['notificationServiceProvider', function(notificationServiceProvider) {
notificationServiceProvider.setDefaults({
styling: "bootstrap3",
history: false
});
}])
.factory('notification', ['notificationService', function (notificationService) {
return {
error: function(title, text, options) {
var hash = { type: 'error', delay: 4000000 };
if (text === null || text === undefined) {
text = "";
}
angular.extend(hash, {title: title, text: text}, options);
notificationService.notify(hash);
},
success: function(title, text, options) {
console.log( PNotify.prototype.options ); /// <<< check defautls >>>>
var hash = { type: 'success', delay: 2000 };
if (text === null || text === undefined) {
text = "";
}
angular.extend(hash, {title: title, text: text}, options);
notificationService.notify(hash);
}
};
}]);
Here is my notificationService
. Where I set my default, particularly the styling
to bootstrap3
.
Then I see no styling in notifications. So I logged PNotify.prototype.options
. And obtains this object:
Object {title: false, title_escape: false, text: false, text_escape: false, styling: "brighttheme"…}
Also this exact code used to work with "angular-pnotify": "~0.0.6"
.
Is that a bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.