Angular Bind with Canvas

Asked

Viewed 40 times

1

Good morning I would like to know if it is possible to bind and/or force angular bind with canvas. My problem is this:

I am using canvas to give a graphical representation to my client and for UI I am using angular 1.6.2, but every time I do a click event associated with canvas I update the variable (eg: marcado: true):

[
    {
    "numero": 1,
    "x": 205,
    "y": 23,
    "marcado": false,
    "descricao": ["a", "b"]
    },
    {
    "numero": 2,
    "x": 502,
    "y": 22,
    "marcado": false,
    "descricao": []
    }
]

It is possible to force the bind inside this function?

canvas.addEventListener('click', function () {
            handlePontosColission(mousePos);
            n++;
            console.log("X " + mousePos.x + " Y " + mousePos.y);
        });

1 answer

1


I solved my problem by adding $scope.$digest() whenever I need to update the variables.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.