例如值发送到角控制,我有HTML,将只显示在弹出我可以通过JavaScript在运行时
<div id="popup1" style="display: none; width: 600px; height: 400px; overflow: hidden">
<div ng-controller="DataBindingCtrl">
<div rel="title">
Show or Update Image
</div>
<div rel="body" style="padding: 10px; line-height: 150%">
<div >
<img src="https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg" style="float: left; background-color: white; width: 250px; height: 320px; border: 1px solid silver; margin: 5px;"/>
</div>
<div class="w2ui-field w2ui-span3">
<label>Files:</label>
<div>
<form class ="form-horizontal">
<input id="file" style="width: 100px" />{{selBookId}}
<input id="currentRecord" type="text" ng-model="currentRecordText" ng-model-instant>
{{currentRecordText}} {{idRec}}
</form>
</div>
</div>
</div>
@*<div rel="buttons">
<button class="btn" onclick="$('#popup2').w2popup()">Switch to Popup 2</button>
</div>*@
</div>
我想为设置一个值idRec当用户点击弹出窗口按钮。
这是可能的,什么是正确的方法?
我想你可以有它的'NG-model'指向'idRec' – Rajesh
一个隐藏的文本字段,当你需要使用jQuery与角度很最好把jQuery的东西放在指令中。然后,您将能够将所需的任何参数从视图传递到指令,并将它们与您的jQuery代码一起使用。 – Lex
你能提供jsfiddle吗? –