jvandemo / angular-growl-notifications Goto Github PK
View Code? Open in Web Editor NEWGrowl notifications for AngularJS
Home Page: http://jvandemo.github.io/angular-growl-notifications/
License: MIT License
Growl notifications for AngularJS
Home Page: http://jvandemo.github.io/angular-growl-notifications/
License: MIT License
The on-open and on-close hooks are only described in the Readme, but not in the documentation (http://jvandemo.github.io/angular-growl-notifications/)
(The link to the documentation below on-open, on-close in the Readme says: "Check out the growl-notification directive documentation for all available options." ^^)
in my opinion it should be possible....
Getting this in the dev console:
Cannot read property 'parent' of undefined...
""
Any ideas?
My growl notification elements have a class on it and nothing else as attributes.
In v1.x, I can add new notification in controller by doing
growlNotifications.add('the content', 'success');
How can I do it in v2.x?
Will these be making a come back?
The growlNotifications.add('some dynamic notification')
methods?
We use these all the time
Hi,
I haven't found any license information for your project. I would love to use it for an app, but I need to state all licenses of 3rd party libs. Is the license available somewhere and I missed it, or is it missing?
Cheers,
Daniel
Hi, sorry to say but it doesn't work for me. I receive error like in title with simplest 'hello world' example.
I defined in the index.html following scripts:
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<script type="text/javascript" src="js/vendor/angular-growl-notifications.js"></script>
<script src="js/main.js"></script>
next, my body looks like this:
<body ng-app="myApp">
{{3+2}}
<growl-notifications>
<growl-notification>hello world</growl-notification>
</growl-notifications>
</body>
and then main.js:
var myApp = angular.module("myApp", ['growlNotifications']);
What I am doing wrong?
br,
ng-if="success"
not really easy to render the same notification multiple times :(
<growl-notification ng-if="success">
Hello world
</growl-notification>
How should we do?
Thanks!
Good afternoon.
I need help with this error that throws me, look in the documentation and did not find anything about a solution, I understand that after is optional "move (element, parent, [after], [options])", I also found a discussion on this error, but it shows nothing of a possible solution.
I will be very grateful if you help me, and sorry for my bad English
Thank you
Heytel
Hi,
All in the title!
Hi,
I am trying to use angular-growl-notifications for notifications. I am having trouble using on-close handler.
Here is the code snippet, I use to include on-close function :
<div><growl-notification ng-if="error" class="alert alert-danger" ttl="50000" on-close="{{onClose()}}" > <strong>{{message}}</strong></growl-notification></d iv>
and in the controller :
var showErrorMessage = function(msg, $scope) {
$scope.message=JSON.stringify(msg);
$scope.error = 1;
$scope.onClose = function(){
console.log("Before error = "+$scope.error);
console.log("onClose called");
$scope.error = 0;
console.log("After error = "+$scope.error);
};
The on-close function gets called immediately multiple times. In addition, it also gets called after the ttl timeout happens. This makes the error flag go to 0 prematurely and not after the ttl timeout has happened, causing the message to not display at all.
Do you think, I am not using it correctly ? In the documentation, I didn't find anything different from what I am doing.
After form submission, in my form view, I want to notify a given kind of error.
I'm forcing the error to always happen.
At first submission the notification happens. Then any further submission does not leverage a new notification.
Is this a expected behavior? If so, how am I supposed to handle it?
My markup:
<span ng-if="err1" growl-notification="{ type: 'danger' }">Foo</span>
Thanks!
Getting the following while trying
bower install angular-growl-notifications :
Additional error details:
Available versions in https://github.com/jvandemo/angular-growl-notifications.git: 2.5.0, 2.4.0, 2.3.0, 2.2.0, 2.1.2, 2.1.1, 2.1.0, 2.0.1, 2.0.0, 0.7.0, 0.6.0, 0.5.0, 0.4.0, 0.3.0, 0.2.0
When state change happens, I'm not able to close the existing Growl notification using $growlNotification.remove();
. It only closes when time-out occurs.
I tried to use the on-close hook, but no luck so far. Neither a function call or just a flag set as in the examples does not work. Has this been updated for angular versions 1.4.0 -> ???
Hello,
I'm currently developing the following project https://github.com/JanStevens/angular-growl-2 now it seems to me our projects have very similar goals. Almost all the features I support are also supported by your project.
The one big difference (except some optional settings), is handling of server sent notifications. I think we can also include this in this project.
Let me know if you are interested in merging the two projects.
Hi I'm receiving the following error : Cannot Read property of 'parent' of undefined.
My HTML :
<div class="notificationHolder">
<div ng-repeat="(iid, notification) in notifications track by notification.iid" class="animNotifcation">
<growl-notification ttl="5000">
<span ng-bind-html="notification.message"></span>
</growl-notification>
</div>
</div>
</div>
My Test event :
$scope.$on("notification", function (event, args) {
index++;
args.notification.iid = index;
args.notification.message += " " + index;
$scope.notifications.push(args.notification);
$timeout(function () {
$scope.notifications.shift();
//$scope.notifications.splice(index, 1);
}, 5000);
});
When I've de-bugged it in google chrome - I located the following line in the link function :
$animate.move(iElem, growlNotifications.element);
and growlNotifications.element is undefined.
I'm using Angular 1.5 with jquery 2.2.4 if that makes a difference.
Hi, when I use the following, the message "Loading growl-Notifications" is appearing on the screen. But then it is remaining their forever, even though I have given ttl=1000, the notification is not disappearing after 1000ms. Could you please let me know, what could be the reason?
Loading growl-Notifications
Any chance that this lib will support interpolation?
That would allow us to Growl strings like "Message sent to {{ email }}".
(Similar to issue JanStevens/angular-growl-2#42)
The "Dynamically adding notifications" example grows the array of notifications indefinitely. Would like to see guidance on when/how to remove the elements from the array in sync with them being hidden from the screen.
When doing this:
// Move the element to the right location in the DOM
$animate.move(iElem, growlNotifications.element);
You are actually not specifiying "after" according to the Angular v1.4.4 documentation for $animate, this will give an error.
This works great when running code in dev mode, but when I run grunt (ngmin, uglify, etc), I receive the following error: undefined is not a function
.
I have removed all references to growlNotifications througout my code, with the exception of my main angular module. When I remove growlNotifications from the main module, everything works fine.
If I skip ngmin and just uglify, I get
Uncaught Error: [$injector:modulerr] Failed to instantiate module choiceAdminApp due to: Error: [$injector:unpr] Unknown provider: a
I glanced at your source code and did not see any obvious offenders.
Any tips on getting growlNotifications working when ngmined and uglified?
I'm trying to implement this directive into my admin panel.
But before I wanted to do any massive work with it I wanted to try it out first.
The result was - it only shows once then ignore every other time I click to make it appear.
Here's my code:
AngularController:
$scope.growl = {
message: '',
messageType: '',
showGrowl: false,
setMessageType: function(type) {
this.messageType = type;
},
getMessageType: function() {
return this.messageType;
},
getMessage: function() {
return this.message;
},
setMessage: function(message) {
this.message = message;
},
reset: function() {
this.message = '';
this.messageType = '';
this.showGrowl = false;
}
};
$scope.successGrowlTest = function() {
$scope.growl.showGrowl = true;
$scope.growl.setMessageType('success');
$scope.growl.setMessage('This is a success test message');
$scope.growl.reset();
};
$scope.warningGrowlTest = function() {
$scope.growl.showGrowl = true;
$scope.growl.setMessageType('warning');
$scope.growl.setMessage('This is a warning test message');
$scope.growl.reset();
};
$scope.errorGrowlTest = function() {
$scope.growl.showGrowl = true;
$scope.growl.setMessageType('error');
$scope.growl.setMessage('This is a error test message');
$scope.growl.reset();
};
I make my own growl-object to be able to set the notification data the way I want it (to be able to variate between different css-classes and so on.
View:
<body>
<growl-notifications class="growl"></growl-notifications>
[...]
<div class="well">
<a ng-click="successGrowlTest()">Success test</a>
<a ng-click="warningGrowlTest()">Warning test</a>
<a ng-click="errorGrowlTest() ">Error test</a>
</div>
<growl-notification class="fading" ng-if="growl.showGrowl === true" ng-class="'bg-' + growl.getMessageType()" ttl="1000">
{{growl.getMessage()}}
</growl-notification>
App.js
var app = angular.module("app", ['ngRoute', 'ngAnimate', 'ngSanitize', 'ngResource', 'ngCookies', 'angular-flash.service', 'angular-flash.flash-alert-directive', 'gettext', 'ui.bootstrap', 'growlNotifications']);
Any clues?
how do i instal it on windows and without using bower?
As referenced in #27 there are some quirks with Angular's Protractor library waiting on the $timeout
service. A full discission of this can be found here.
Proposal:
As mentioned in this comment Protractor does not need to wait on the $interval
service and so end to end tests perform as standard.
Replace
// TTL = 5000
$timeout(function () { }, TTL) //...
with
// only run this interval once - replicating the functionality found in $timeout
var REPEATS = 1;
$interval(function () {}, TTL, REPEATS) //...
I have verified that this change has no breaking implications, however there may be something I've missed. If this is discussed and approved it can be easily implemented.
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.