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 #12

Closed
Djcd opened this issue Apr 28, 2014 · 2 comments
Closed

Sometimes single message not shown #12

Djcd opened this issue Apr 28, 2014 · 2 comments
Labels

Comments

@Djcd
Copy link

Djcd commented Apr 28, 2014

Same as

marcorinck#18

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
}

Credits & thx to CalmNad

@JanStevens
Copy link
Owner

maybe its better to wrap everything in a $timeout so it will be added in the next digest cycle? Not really fan of manually triggering $apply(). I already use a $timeout for deleting the message.

I'll look into it. Thanks!

@JanStevens JanStevens added the bug label Apr 28, 2014
@ChrisMurphy
Copy link

Experiencing the same +1

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

No branches or pull requests

3 participants