我可以在ng-when中使用或逻辑吗?

时间:2014-01-12 18:40:58

标签: angularjs

我想做这样的事情:

<ANY ng-switch-when="matchValue1 || matchValue2">...</ANY>

为了简化我的表达,目前我为matchValue1和matchValue2做同样的事情。

1 个答案:

答案 0 :(得分:1)

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

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