Angular 2 * ngIf语句具有多个值 [英] Angular 2 *ngIf statement with multiple values
本文介绍了Angular 2 * ngIf语句具有多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
也许是一个过时的问题,但我无法解决它.
Maybe an outdated question but I cant get it to work.
我有一个*ngIF
语句,我想使用多个这样的条件:
I have an *ngIF
statement and i want to use multiple conditions like this:
*ngIf="expression && prototype?.valueType === 'Integer' && 'String'"
如何设置具有多个条件的*ngIf
?
How do I set this *ngIf
with multiple conditions?
推荐答案
这通常可以正常工作.
表达式
*ngIf="expression && prototype?.valueType === 'Integer' && 'String'"
似乎有点不对.
也许您想要类似的东西
*ngIf="expression && (prototype?.valueType === 'Integer' || prototype?.valueType === 'String'")
这篇关于Angular 2 * ngIf语句具有多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文