void testSwitch(byte x) {
switch(x) {
case 'a': // 1
case 256: // 2
default: // 3
case 1: // 4
}
Error: [$parse:syntax] http://errors.angularjs.org/1.2.28/$parse/syntax?p0=or&p1=is%20an%20unexpected%20token&p2=34&p3=group.title%20!%3D%20'Local'"<!-- ngIf: group.title != 'Local' or group.title != 'Server' -->"r%20group.title%20!%3D%20'Server%20News'&p4=or%20group.title%20!%3D%20'Server%20News'
答案 0 :(得分:1)
此表达式始终为true,因为group.title不能是&#39; Local&#39;和&#39;服务器&#39;一起。
group.title != 'Local' || group.title != 'Server'
换句话说,如果group.title =&#39; Local&#39;,你有
false || true = true
如果group.title =&#39;服务器&#39;,您有
true || false = true
如果group.title =&#39; somethingElse&#39;,你有
true || true = true
我想你想要做以下事情:
group.title != 'Local' && group.title != 'Server' // note the && instead of ||
这意味着:显示&#34;组中没有链接。&#34;如果group.title不是&#39; Local&#39;并且也不是&#39; Server&#39;