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

In callback function array is not visible from scope #283

Open
bestin-it opened this issue May 4, 2018 · 3 comments
Open

In callback function array is not visible from scope #283

bestin-it opened this issue May 4, 2018 · 3 comments

Comments

@bestin-it
Copy link

Hi,

when you run $scope.AddItem function for example 3 times and call function $scope.Test you will see that the size of $scope.items is equal 3.
But when you click 'del' you will see that $scope.items size is 0.

Why ?

        hotkeys.bindTo($scope)
            .add({
                combo: 'del',
                description: 'blah blah',
                callback: function () {
                    $scope.Test();
                }
            })

           
            $scope.Test = function()
            {
                alert($scope.items.length);
            }

            $scope.AddItem = function()
            {
                $scope.items.push({ test: 'Test' });
            }
@aramando
Copy link

aramando commented May 8, 2018

Works fine for me: https://plnkr.co/MtiI5X

@bestin-it
Copy link
Author

The link does not work. Can you send working example ?

@aramando
Copy link

Hmm yeah it seems to have trouble loading, but if you click the "Launch in Editor" button you can see the code and run it.

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

2 participants