I am trying to create an application that edits simple graphics on the screen, fabricjs is the canvas library I use, and angularjs is the MVW environment I use.
Now the bindings from the DOM to the material work just fine (I press div and the corresponding object on the canvas is selected), but not vice versa. When I click an object on the canvas and it is selected, the corresponding DOM is not updated. I read here that I should use $scope.$apply(); but I'm not sure where to put it.
How to update for $scope state fabric?
You can see the code here , click the Add Rect button to add elements to the canvas, and note that when you click on an element, the name on the right is selected on the canvas, but if you select it directly on the canvas, the button will not be lit.
code: http://plnkr.co/edit/lMogPGjJOXx9HLAdiYqB
angularjs fabricjs
Meight
source share