Giter Club home page Giter Club logo

angular-growl-notifications's Issues

class="ng-scope" error in dev console

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.

v2 dynamic notifications

Will these be making a come back?
The growlNotifications.add('some dynamic notification') methods?

We use these all the time

License information missing

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

Cannot read property 'parent' of undefined

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']);

Result below
image

What I am doing wrong?
br,

Render same notification multiple times

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!

Error: after is undefined

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

on-close function gets called immediately

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.

Notification lifecycle

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>

Inline HTML

Inline HTML does not seem to work when I add notification dynamically, is there a config I need to enable?

image

on-close not working

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 -> ???

Possible Merging of two projects

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.

Cannot read property 'parent' of undefined

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.

growl notification ttl is not getting applied

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

undefined is not a function when minified

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?

Shows first time, then nomore

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?

(Proposal) Replace $timeout with $interval (Accommodate Protractor tests)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.