【发布时间】:2016-01-19 00:32:01
【问题描述】:
您能告诉我如何在 angular 中获取元素的选择事件吗? 我用这个 github 做了一个演示 https://github.com/codecapers/AngularJS-FlowChart
现场演示 https://dl.dropboxusercontent.com/u/16408368/WebUI_FlowChart/index.html
在演示中,用户可以选择节点并删除节点。我想获得节点的点击事件。我想获得选定的对象。 我们可以在角度js中获取选定的对象或节点的点击事件吗
这是我的代码 http://plnkr.co/edit/vTgDa3AfY8aiWVgUgZf8?p=preview
<div ng-controller="cntrl" style="width: 100%; height:100%;">
<div style="width: 100%; height:100%;">
<flow-chart
style="margin: 5px; width: 100%; height: 100%;"
chart="chartViewModel"
>
</flow-chart>
</div>
</div>
有什么更新吗?
【问题讨论】:
-
您不能将 ng-click="someFunc" 附加到每个节点并在您的视图模型中捕获该事件吗?
标签: javascript angularjs angularjs-directive angularjs-scope angular-ui-router