Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 我可以在ng中使用or逻辑吗_Angularjs - Fatal编程技术网

Angularjs 我可以在ng中使用or逻辑吗

Angularjs 我可以在ng中使用or逻辑吗,angularjs,Angularjs,我想这样做: <ANY ng-switch-when="matchValue1 || matchValue2">...</ANY> 。。。 为了简化表达式,目前我对matchValue1和matchValue2执行相同的操作。“请注意,要匹配的属性值不能是表达式。它们被解释为要匹配的文字字符串值。例如,ng switch when=“someVal”将匹配字符串“someVal”“不针对表达式$scope.someVal的值。” 使用ng show在您的情况下会很有用

我想这样做:

<ANY ng-switch-when="matchValue1 || matchValue2">...</ANY>
。。。
为了简化表达式,目前我对matchValue1和matchValue2执行相同的操作。

“请注意,要匹配的属性值不能是表达式。它们被解释为要匹配的文字字符串值。例如,ng switch when=“someVal”将匹配字符串“someVal”“不针对表达式$scope.someVal的值。”


使用
ng show
在您的情况下会很有用。

使用ngIf而不是ngSwitch。我会给出一个真实的答案,但是@JBNizet已经给出了最好的答案作为注释。ng if可以使用OR