titlte/tooltip 对布尔变化 HTML 的反应, AngularJS.
titlte/tooltip reaction on boolean change HTML, AngularJS
如何使用 2 个不同的工具提示标题来表示真或假......我被困在了那一刻
title="{'text1' : attribute===true , 'text2' : attribute===false}"
这似乎不是正确的方法...你们的一点帮助会很好。提前感谢
只需执行以下操作:
title="{{ attribute ? 'text1' : 'text2'}}"
只需使用 AngularJS 三元运算符:
title="{{ attribute ? 'text1' : 'text2' }}"
如果attribute
是true
,那么text1
其他text2
。
三元运算符可以做到这一点。
title="{{ attribute ? 'text1' : 'text2' }}";
简单地说,使用问号作为最小的 if()
title="{{attribute?'text1':'text2'}}
在我看来,这是最简单的方法。
使用三元运算符。
title="{{ attribute ? 'text1' : 'text2' }}";
相关文章:
- AngularJS/HTML/Bootstrap元素用于动态搜索结果
- angularjs html中动态表的分页
- angularjs html 5 mode
- 如何使用多子对象值构建 angularjs html 格式
- AngularJS HTML 5 输入范围输出
- AngularJS/HTML 表格格式
- Angularjs: HTML DOM is not updated
- 占位符和标题中的Angularjs html替代字符串
- AngularJS/HTML输入周格式错误
- 输入url时,AngularJS HTML子路由不显示
- AngularJS html绑定和Chome应用程序CSP
- AngularJS-html中的scope变量语法
- AngularJS: HTML选择使用map中的值,键按升序排列
- AngularJS-html渲染和ng-bind-html不安全
- AngularJS/HTML -引入拦截器后无法执行指向同一页面的链接
- Angularjs Html with CSS with in the TAG
- AngularJS - html select的数据绑定默认值
- 下拉列表>input type="text">Angularjs / HTML / Nodejs /
- AngularJS-HTML在ng重复中失去了模板替换的作用域
- AngularJS (HTML, CSS) 在客户端转换为 pdf