html - 使用 AngularJS 的动态工具提示

标签 html angularjs tooltip

我想添加一个工具提示,它会在鼠标悬停在下面的元素上时显示。

<a ng-click="click(this)">
<span class="icon"></span>
</a>
{{product.title}}

我在 product.desc 中有工具提示。 我尝试使用以下代码:

 <span tooltip="{{product.desc}}" class="glyphicon"></span>

但这行不通。 有什么想法/建议吗?请帮忙。

[编辑] 当我使用开发人员工具检查时,我可以看到 product.desc 的值按预期存在于页面的源代码中。

谢谢

最佳答案

代替

<span tooltip="{{product.desc}}" class="glyphicon"></span> 

我们需要给予

<span data-toggle="tooltip" title="{{product.desc}}" class="glyphicon"></span>

关于html - 使用 AngularJS 的动态工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29275335/

相关文章:

html - 我应该选择 <button> 元素还是 css 按钮?

javascript - 在 Angular 中要求/浏览连帽衫

angularjs - 如何从 webapp 运行 Protractor ?

javascript - 使用 Node.JS 和 AngularJS 在 HTML 中显示 Redis 值

angularjs - angularjs 中的工具提示,带有 "uib-tooltip-html"

r - 如何将工具提示添加到 R shiny 中的数据表行名?

javascript - PHP:- 在 newtab 中通过 POST 验证并传递值

jquery - 如何通过 jquery 或其他类型修改 iframe 中的 css?

html - 如何在 Visual Studio Code 中格式化 PHP 文件中的 HTML

ruby-on-rails - 如何将工具提示添加到事件管理索引页面中的操作项