【发布时间】:2014-09-11 13:48:47
【问题描述】:
我正在读取一个 Json 文件并使用角度模板动态创建元素。我想将事件绑定到 json 文件中提到的 ng-click,但它会引发异常。请帮助。 提前致谢。
<button id="{{controls.id}}" ng-click='{{controls.onAction}}' title="{{controls.tooltipText}}"
ng-mouseover="mouseOver(this)" ng-mouseout="mouseOut(this)" style="font-size: 70%;
border: none; border-spacing: 1px;" class="button">
<img src="{{controls.imageSrc}}" class="image{{tabBoxes.Type}}" id="Img1" />
{{controls.label}}
</button>
【问题讨论】:
-
最好把代码贴在这里..因为我们不是读心者
标签: angularjs templates angularjs-ng-click dynamic-binding