gpt4 book ai didi

Angular 2 [ngSwitchCase] 不支持负值?

转载 作者:太空狗 更新时间:2023-10-29 18:14:06 26 4
gpt4 key购买 nike

注释掉 <span *ngSwitchCase="-1">&darr;</span>不返回错误

<span class="pull-left ranking-movement" [ngSwitch]="profile.rankingMovement">
<span *ngSwitchCase="1">&uarr;</span>
<span *ngSwitchCase="0">&#9472;</span>
<span *ngSwitchCase="-1">&darr;</span>
</span>

ngSwitchCase 不支持负数吗? ?

错误如下:

main.js?v1:23062 Unhandled Promise rejection: Template parse errors:
Parser Error: Unexpected token 1, expected identifier, keyword, or string at column 15 in [ngSwitchCase -1] in MainComponent@93:42 (" <span *ngSwitchCase="0">&#9472;</span>
<span [ERROR ->]*ngSwitchCase="-1">&darr;</span>
</span>
"): MainComponent@93:42
Parser Error: Unexpected token 1, expected identifier, keyword, or string at column 15 in [ngSwitchCase -1] in MainComponent@93:42

我正在使用 RC.6

最佳答案

我不知道为什么不支持,但你可以解决

<span *ngSwitchCase="0 - 1">&darr;</span>

关于Angular 2 [ngSwitchCase] 不支持负值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39445746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com