Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我怎样才能做这样的ng-hide内联表达式:
ng-hide
ng-hide="userType!=user"
?
你的用户类型是什么?一个字符串?如果 != 'user' 你想隐藏
ng-hide="userType!='user'"
请检查这个关于 ng-hide/ng-show 的答案
ngHide 指令不适用于内联表达式。对内联表达式求值,然后将结果注入到包含该表达式的 HTML 元素中。
如果内联表达式只是纯文本,您可以尝试以下操作:
{{ userType != user ? "" : value }}
或者如果您不想要一个空字符串,您也可以使用“null”
{{ userType != user ? null : value }}