Angled Bind with Canvas

1

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

I'm using the canvas to give a graphical representation of my client and for UI I'm using angular 1.6.2, but whenever I do a click event associated with the canvas I update the variable (ex: marcado: true ) :

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

Is it possible to force bind within this function?

canvas.addEventListener('click', function () {
            handlePontosColission(mousePos);
            n++;
            console.log("X " + mousePos.x + " Y " + mousePos.y);
        });
    
asked by anonymous 29.05.2017 / 10:58

1 answer

1

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

    
29.05.2017 / 11:11