我需要帮助试图将以下变量绑定到使用Angular JS的HTML属性。在我的控制文件,我有这个角度js绑定标题属性
controller.js
$scope.errorDialog = function(errorTitle, errorMessage){
$scope.errorTitle = errorTitle;
$scope.errorMessage = errorMessage;
$("#dialog-confirm").dialog('open');
}
errorTitle的errorMessage和参数都在其他功能设置。
在我的HTML文件,我有这样的错误消息框(使用jQuery UI)
abc.html
<div title="{{errorTitle}}" id="dialog-confirm" >
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:12px 12px 20px 0;"></span>{{errorMessage}}</p>
</div>
出于某种原因没有显示的标题。我尝试将其更改为 ng-attr-title =“{{errorTitle}}”,但这也不起作用。我也尝试在title属性中使用一个函数,并返回errorTitle的值,但似乎也不起作用。
的可能的复制[你如何让AngularJS绑定到A标签的title属性?](http://stackoverflow.com/questions/18230868/how-do-you-get-angularjs-to-bind-to-the-title -attribute-of-an-tag) – Canastro
你能展示一些更多的代码吗?特别是你实现jQuery UI消息框的方式。 –
@Canastro我做这件事之前,经历了这个职位。我已经尝试了ng-attr-title,但它仍然不起作用 – NimazSheik