AngularJS how to bind data with SVG widget

前端 未结 2 465
天命终不由人
天命终不由人 2021-02-06 02:49

I know that this is usually not the way to use AngularJS but I was wondering if what I want to achieve is doable with AngularJS. If this is not the recommended way could you ple

2条回答
  •  面向向阳花
    2021-02-06 03:21

    You could get hold of the controller, but that would make the whole communication between SVG and your app in-side-out. Instead invert how the application is composed: Let angular drive the app and wrap the svg using a directive into a reusable component as Dan mentioned.

    btw using SVG and angular is not such a rare thing. check out this pretty awesome example: http://sullerandras.github.com/SVG-Sequence-Diagram/

提交回复
热议问题