属性中的角度表达式 [英] Angular expression in attribute

查看:97
本文介绍了属性中的角度表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用angular的页面,我从bootstrap实现popover:

I have a page using angular where im implementing popover from bootstrap:

<img class="state-msg" data-toggle="popover" ng-popover data-content="{{item.status.message}}" data-trigger="hover" data-placement="top" ng-src="{{item.status.stateIcon}}"/>

数据内容无法正确呈现。它返回文字{{item.status.message}}而不是消息的值。

The data-content doesnt get rendered correctly. It returns literaly {{item.status.message}} instead of the value of message.

角度在'data-'属性中是否有问题?

Does angular have an issue w expressions in 'data-' attributes?

Tnx

推荐答案

删除这样的插值符号。使用 {{,}} ,AngularJS会进行字符串插值而不是模型绑定。

Remove the interpolation notation like this. With {{, }}, AngularJS does string interpolation rather than model binding.

data-content="item.status.message"

这篇关于属性中的角度表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆