Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes single message not shown (angular 1.2.6). #18

Open
CalmNad opened this issue Jan 17, 2014 · 2 comments
Open

Sometimes single message not shown (angular 1.2.6). #18

CalmNad opened this issue Jan 17, 2014 · 2 comments

Comments

@CalmNad
Copy link

CalmNad commented Jan 17, 2014

Sometimes single message not shown (angular 1.2.6). Сorrected by adding $scope.$apply() to addMessage in directive:

function addMessage(message) {
    $scope.messages.push(message);
    if (message.ttl && message.ttl !== -1) {
        $timeout(function () {
            $scope.deleteMessage(message);
        }, message.ttl);
    }
    $scope.$apply();  // this line fix problem
}
@datr
Copy link

datr commented Jan 25, 2014

Was able to recreate this issue. Suggested fix resolved it for me.

stelcheck pushed a commit to stelcheck/angular-growl that referenced this issue Jul 12, 2014
Add option to reverse order messages
@jpdean123
Copy link

Thanks that fixed the issue for me too.

Not sure if this helps for the developers, but I was finding that sometimes I would need to run a function twice (within the global ttl) to get a msg to show.

For example, I had a notification come up on button click. But I would have to click the button twice within 5 seconds (my global ttl setting) for just one to show up.

Elsewhere I have similar functionality and it seems to be working fine so it is certainly my code that is the issue. But I wasn't getting any errors and putting a console.log("anything") right before the growl. command would console log correctly.

Anyways, thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants