如何使比angularjs比较小于或大于 [英] How to make less than or greater than comparison in angularjs

查看:1308
本文介绍了如何使比angularjs比较小于或大于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请任何人解释如何做到在angularjs检查以下

Please anybody explain how to do below check in angularjs

<div ng-show="{{offset <= 10}}">Show Me</div>

如果我喜欢这个它打破了HTML运行它,我认为,由于&LT;比比较

If i run it like this it breaks the html, i think due to "<" than in comparison

推荐答案

不要使用 {{}} 取值:

<div ng-show="offset <= 10">Show Me</div>

考虑到NG-节目的前pression根据当前评估的范围,因此没有必要进行插值&ndash的;在 {{}} 秒。

您需要的 {{}} ■如果你想要做这样的事情:

You would need the {{}}s if you wanted to do something like this:

<div>Offset is <= 10: {{offset <= 10}}</div>

这篇关于如何使比angularjs比较小于或大于的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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